38using namespace SVFUtil;
82 DBOUT(
DSaber,
outs() <<
"Forward analysis reaches globals for slice:" << (*iter)->getId() <<
")\n");
86 DBOUT(
DSaber,
outs() <<
"Forward process for slice:" << (*iter)->getId() <<
" (size = " <<
getCurSlice()->getForwardSliceSize() <<
")\n");
96 DBOUT(
DSaber,
outs() <<
"Backward process for slice:" << (*iter)->getId() <<
" (size = " <<
getCurSlice()->getBackwardSliceSize() <<
")\n");
104 DBOUT(
DSaber,
outs() <<
"Guard computation for slice:" << (*iter)->getId() <<
")\n");
145 if(
edge->isCallDirectVFGEdge())
150 else if(
edge->isRetDirectVFGEdge())
161 if(SVFUtil::isa<IntraDirSVFGEdge>(
edge))
170 else if(SVFUtil::isa<IntraIndSVFGEdge>(
edge))
172 if(SVFUtil::isa<LoadSVFGNode, IntraMSSAPHISVFGNode>(
succ))
212 if (
edge->isCallVFGEdge())
218 csId = SVFUtil::cast<CallIndSVFGEdge>(
edge)->getCallSiteId();
224 else if (
edge->isRetVFGEdge())
230 csId = SVFUtil::cast<RetIndSVFGEdge>(
edge)->getCallSiteId();
232 if (
newItem.matchContext(csId) ==
false)
259 DBOUT(
DSaber,
outs() <<
"backward propagate from (" <<
edge->getDstID() <<
" --> " <<
edge->getSrcID() <<
")\n");
#define DBOUT(TYPE, X)
LLVM debug macros, define type of your DBUG model of each pass.
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
static void setMaxCxtLen(u32_t max)
set max context limit
iterator OutEdgeBegin()
iterators
void setGraph(GraphType g)
WorkList worklist
Worklist for resolution.
bool pushIntoWorklist(DPIm &item)
virtual void backwardTraverse(DPIm &it)
CFL forward traverse solve.
virtual void forwardTraverse(DPIm &it)
CFL forward traverse solve.
static const Option< u32_t > CxtLimit
static const Option< bool > SABERFULLSVFG
static const Option< u32_t > MaxStepInWrapper
static const Option< bool > DumpSlice
PTACallGraph * getCallGraph() const
Return call graph.
bool AllPathReachableSolve()
Guarded reachability solve.
NodeID getId() const
Get ID.
SVFG * getSVFG() const
Get SVFG instance.
SVFG * buildFullSVFG(BVDataPTAImpl *pta)
SVFG * buildPTROnlySVFG(BVDataPTAImpl *pta)
void addToBackwardSlice(const SVFGNode *node)
void addToSources(const SVFGNode *node)
void addToSinks(const SVFGNode *node)
void addToForwardSlice(const SVFGNode *node)
SVFGStat * getStat() const
Return statistics.
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
void allocate(const SVFModule *module)
Perform path allocation.
std::string getMemUsage()
Statistics.
void setSaberCondAllocator(SaberCondAllocator *allocator)
bool test(unsigned Idx) const
SVFGNodeSetIter sourcesBegin() const
virtual void initSnks()=0
virtual void initSrcs()=0
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
void addForwardVisited(const SVFGNode *node, const DPIm &item)
SVFGNodeSetIter sinksBegin() 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.
void addBackwardVisited(const SVFGNode *node)
virtual void reportBug(ProgSlice *slice)=0
report bug on the current analyzed slice
SVFGNodeSetIter sinksEnd() const
virtual void setCurSlice(const SVFGNode *src)
Slice operations.
virtual void analyze(SVFModule *module)
Start analysis here.
void dumpSlices()
Dump SVFG with annotated slice information.
void FWProcessOutgoingEdge(const DPIm &item, SVFGEdge *edge) override
Propagate information forward by matching context.
SVFGNodeSetIter sourcesEnd() const
SVFGNodeSet::const_iterator SVFGNodeSetIter
const SVFG * getSVFG() const
Get SVFG.
SaberCondAllocator * getSaberCondAllocator() const
Get saber condition allocator.
virtual void finalize()
Finalize analysis.
bool isInAWrapper(const SVFGNode *src, CallSiteSet &csIdSet)
Identify allocation wrappers.
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
const CallICFGNode * getCallSite(CallSiteID id) const
LLVM_NODISCARD bool isa(const Y &Val)
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder
void dump(const SparseBitVector< ElementSize > &LHS, std::ostream &out)