37#ifndef SRCSNKANALYSIS_H_
38#define SRCSNKANALYSIS_H_
228 return sinks.begin();
283 return it->second.find(
item)!=
it->second.end();
const GraphType graph() const
Get/Set graph methods.
GNODE * getNode(NodeID id) const
void addToForwardSlice(const SVFGNode *node)
Forward and backward slice operations.
bool inBackwardSlice(const SVFGNode *node)
bool isAllReachable() const
bool isPartialReachable() const
Set< const SVFGNode * > SVFGNodeSet
bool inForwardSlice(const SVFGNode *node)
FIFOWorkList< const SVFGNode * > VFWorkList
worklist for value-flow guard computation
void addToBackwardSlice(const SVFGNode *node)
void addToSinks(const SVFGNode *node)
void setPartialReachable()
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
bool isGlobalSVFGNode(const SVFGNode *node) const
SVFGNodeSetIter sourcesBegin() const
const SVFGNodeSet & getSources() const
Get sources/sinks.
virtual void initSnks()=0
std::unique_ptr< SaberCondAllocator > saberCondAllocator
source nodes
virtual bool isSomePathReachable()
Whether it is some path reachable from a source.
ProgSlice::SVFGNodeSet SVFGNodeSet
virtual void initSrcs()=0
SVFGNodeSet visitedSet
record backward visited nodes
bool backwardVisited(const SVFGNode *node)
bool isGlobalSVFGNode(const SVFGNode *node) const
Whether this svfg node may access global variable.
SVFIR * getPAG() const
Get SVFIR.
void BWProcessIncomingEdge(const DPIm &item, SVFGEdge *edge) override
Propagate information backward without matching context, as forward analysis already did it.
ProgSlice::VFWorkList WorkList
Set< const CallICFGNode * > CallSiteSet
bool isInCurForwardSlice(const SVFGNode *node)
bool isInCurBackwardSlice(const SVFGNode *node)
Map< const SVFGNode *, DPImSet > SVFGNodeToDPItemsMap
map a SVFGNode to its visited dpitems
void addForwardVisited(const SVFGNode *node, const DPIm &item)
void addToCurForwardSlice(const SVFGNode *node)
~SrcSnkDDA() override
Destructor.
SVFGNodeToDPItemsMap nodeToDPItemsMap
record forward visited dpitems
PTACallGraph * getCallgraph() const
Get Callgraph.
virtual bool isAllPathReachable()
Whether it is all path reachable from a source.
void addSinkToCurSlice(const SVFGNode *node)
bool isSink(const SVFGNode *node) const
SVFGNodeSetIter sinksBegin() const
bool isSource(const SVFGNode *node) const
ProgSlice * getCurSlice() const
void annotateSlice(ProgSlice *slice)
virtual void initialize(SVFModule *module)
Initialize analysis.
bool forwardVisited(const SVFGNode *node, const DPIm &item)
Whether has been visited or not, in order to avoid recursion on SVFG.
SVFGNodeSet sources
current program slice
void addToSinks(const SVFGNode *node)
void addBackwardVisited(const SVFGNode *node)
const SVFGNodeSet & getSinks() const
virtual void reportBug(ProgSlice *slice)=0
report bug on the current analyzed slice
SVFGNodeSetIter sinksEnd() const
SVFGNodeSet sinks
source nodes
virtual void setCurSlice(const SVFGNode *src)
Slice operations.
virtual bool isSinkLikeFun(const SVFFunction *fun)
Set< DPIm > DPImSet
dpitem set
const SVFBugReport & getBugReport() const
virtual void analyze(SVFModule *module)
Start analysis here.
Map< const SVFGNode *, ProgSlice * > SVFGNodeToSliceMap
void dumpSlices()
Dump SVFG with annotated slice information.
void FWProcessOutgoingEdge(const DPIm &item, SVFGEdge *edge) override
Propagate information forward by matching context.
void addToSources(const SVFGNode *node)
SVFGNodeSetIter sourcesEnd() const
void addToCurBackwardSlice(const SVFGNode *node)
void FWProcessCurNode(const DPIm &item) override
Forward traverse.
SVFGNodeSet::const_iterator SVFGNodeSetIter
void BWProcessCurNode(const DPIm &item) override
Backward traverse.
const SVFG * getSVFG() const
Get SVFG.
SaberCondAllocator * getSaberCondAllocator() const
Get saber condition allocator.
virtual bool isSourceLikeFun(const SVFFunction *fun)
virtual void finalize()
Finalize analysis.
bool isInAWrapper(const SVFGNode *src, CallSiteSet &csIdSet)
Identify allocation wrappers.
GraphReachSolver< SVFG *, CxtDPItem > CFLSrcSnkSolver
llvm::IRBuilder IRBuilder