Static Value-Flow Analysis
|
#include <ContextDDA.h>
Public Member Functions | |
ContextDDA (SVFIR *_pag, DDAClient *client) | |
Constructor. More... | |
virtual | ~ContextDDA () |
Destructor. More... | |
virtual void | initialize () override |
Initialization of the analysis. More... | |
virtual void | finalize () override |
Finalize analysis. More... | |
virtual void | analyze () override |
dummy analyze method More... | |
virtual void | computeDDAPts (NodeID id) override |
Compute points-to set for an unconditional pointer. More... | |
virtual const CxtPtSet & | computeDDAPts (const CxtVar &cxtVar) |
Compute points-to set for a context-sensitive pointer. More... | |
void | handleOutOfBudgetDpm (const CxtLocDPItem &dpm) |
Handle out-of-budget dpm. More... | |
virtual CxtPtSet | getConservativeCPts (const CxtLocDPItem &dpm) override |
Override parent method. More... | |
virtual NodeID | getPtrNodeID (const CxtVar &var) const override |
Override parent method. More... | |
virtual bool | handleBKCondition (CxtLocDPItem &dpm, const SVFGEdge *edge) override |
Handle condition for context or path analysis (backward analysis) More... | |
virtual bool | isHeapCondMemObj (const CxtVar &var, const StoreSVFGNode *store) override |
bool | testIndCallReachability (CxtLocDPItem &dpm, const SVFFunction *callee, const CallICFGNode *cs) |
refine indirect call edge More... | |
CallSiteID | getCSIDAtCall (CxtLocDPItem &dpm, const SVFGEdge *edge) |
get callsite id from call, return 0 if it is a spurious call edge More... | |
CallSiteID | getCSIDAtRet (CxtLocDPItem &dpm, const SVFGEdge *edge) |
get callsite id from return, return 0 if it is a spurious return edge More... | |
virtual void | popRecursiveCallSites (CxtLocDPItem &dpm) |
Pop recursive callsites. More... | |
virtual bool | isEdgeInRecursion (CallSiteID csId) |
Whether call/return inside recursion. More... | |
virtual void | updateCallGraphAndSVFG (const CxtLocDPItem &dpm, const CallICFGNode *cs, SVFGEdgeSet &svfgEdges) override |
Update call graph. More... | |
bool | edgeInCallGraphSCC (const SVFGEdge *edge) |
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the SVFG. More... | |
virtual CxtPtSet | processGepPts (const GepSVFGNode *gep, const CxtPtSet &srcPts) override |
processGep node More... | |
virtual void | handleAddr (CxtPtSet &pts, const CxtLocDPItem &dpm, const AddrSVFGNode *addr) override |
Handle Address SVFGNode to add proper conditional points-to. More... | |
virtual bool | propagateViaObj (const CxtVar &storeObj, const CxtVar &loadObj) override |
Propagate along indirect value-flow if two objects of load and store are same. More... | |
virtual bool | isCondCompatible (const ContextCond &cxt1, const ContextCond &cxt2, bool singleton) const override |
bool | isInsensitiveCallRet (const SVFGEdge *edge) |
Whether this edge is treated context-insensitively. More... | |
ConstSVFGEdgeSet & | getInsensitiveEdgeSet () |
Return insensitive edge set. More... | |
virtual void | dumpContexts (const ContextCond &cxts) |
dump context call strings More... | |
virtual const std::string | PTAName () const override |
Return PTA name. More... | |
Public Member Functions inherited from SVF::CondPTAImpl< ContextCond > | |
CondPTAImpl (SVFIR *pag, PointerAnalysis::PTATY type) | |
map a pointer to its conditional points-to set More... | |
virtual | ~CondPTAImpl () |
Destructor. More... | |
void | destroy () |
Release memory. More... | |
PTDataTy * | getPTDataTy () const |
Get points-to data. More... | |
MutPTDataTy * | getMutPTDataTy () const |
bool | hasPtsMap (void) const |
const MutPTDataTy::PtsMap & | getPtsMap () const |
virtual const CPtSet & | getPts (CVar id) |
virtual PointsTo & | getPts (NodeID ptr) |
Given a pointer return its bit vector points-to. More... | |
virtual const Set< CVar > & | getRevPts (CVar nodeId) |
virtual NodeSet & | getRevPts (NodeID obj) |
Given an object return all pointers points to this object. More... | |
virtual void | clearPts () |
Clear all data. More... | |
bool | overlap (const CPtSet &cpts1, const CPtSet &cpts2) const |
Whether cpts1 and cpts2 have overlap points-to targets. More... | |
void | expandFIObjs (const CPtSet &cpts, CPtSet &expandedCpts) |
Expand all fields of an aggregate in all points-to sets. More... | |
virtual void | dumpCPts () |
Print out conditional pts. More... | |
virtual PointsTo | getBVPointsTo (const CPtSet &cpts) const |
Given a conditional pts return its bit vector points-to. More... | |
virtual const CPtSet & | getCondPointsTo (NodeID ptr) |
Given a pointer return its conditional points-to. More... | |
virtual AliasResult | alias (const SVFValue *V1, const SVFValue *V2) |
Interface expose to users of our pointer analysis, given Value infos. More... | |
virtual AliasResult | alias (NodeID node1, NodeID node2) |
Interface expose to users of our pointer analysis, given two pointers. More... | |
virtual AliasResult | alias (const CVar &var1, const CVar &var2) |
Interface expose to users of our pointer analysis, given conditional variables. More... | |
virtual AliasResult | alias (const CPtSet &pts1, const CPtSet &pts2) |
Interface expose to users of our pointer analysis, given two conditional points-to sets. More... | |
bool | containBlackHoleNode (const CPtSet &cpts) |
Test blk node for cpts. More... | |
bool | containConstantNode (const CPtSet &cpts) |
Test constant node for cpts. More... | |
void | dumpTopLevelPtsTo () |
Dump points-to information of top-level pointers. More... | |
Public Member Functions inherited from SVF::PointerAnalysis | |
ICFG * | getICFG () const |
Get ICFG. More... | |
u32_t | getNumOfResolvedIndCallEdge () const |
Return number of resolved indirect call edges. More... | |
PTACallGraph * | getCallGraph () const |
Return call graph. More... | |
CallGraphSCC * | getCallGraphSCC () const |
Return call graph SCC. More... | |
PointerAnalysis (SVFIR *pag, PTATY ty=Default_PTA, bool alias_check=true) | |
Constructor. More... | |
PTATY | getAnalysisTy () const |
Type of pointer analysis. More... | |
PTAImplTy | getImplTy () const |
Return implementation type of the pointer analysis. More... | |
bool | printStat () |
Whether print statistics. More... | |
void | disablePrintStat () |
Whether print statistics. More... | |
CallEdgeMap & | getIndCallMap () |
Get callees from an indirect callsite. More... | |
bool | hasIndCSCallees (const CallICFGNode *cs) const |
const FunctionSet & | getIndCSCallees (const CallICFGNode *cs) const |
virtual void | resolveIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges) |
Resolve indirect call edges. More... | |
void | callGraphSCCDetection () |
PTACallGraph SCC related methods. More... | |
NodeID | getCallGraphSCCRepNode (NodeID id) const |
Get SCC rep node of a SVFG node. More... | |
bool | inSameCallGraphSCC (const SVFFunction *fun1, const SVFFunction *fun2) |
Return TRUE if this edge is inside a PTACallGraph SCC, i.e., src node and dst node are in the same SCC on the SVFG. More... | |
bool | isInRecursion (const SVFFunction *fun) const |
bool | isLocalVarInRecursiveFun (NodeID id) const |
Whether a local variable is in function recursions. More... | |
CommonCHGraph * | getCHGraph () const |
get CHGraph More... | |
void | getVFnsFromCHA (const CallICFGNode *cs, VFunSet &vfns) |
void | getVFnsFromPts (const CallICFGNode *cs, const PointsTo &target, VFunSet &vfns) |
void | connectVCallToVFns (const CallICFGNode *cs, const VFunSet &vfns, CallEdgeMap &newEdges) |
virtual void | resolveCPPIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges) |
Resolve cpp indirect call edges. More... | |
SVFIR * | getPAG () const |
PTAStat * | getStat () const |
Get PTA stat. More... | |
SVFModule * | getModule () const |
Module. More... | |
OrderedNodeSet & | getAllValidPtrs () |
Get all Valid Pointers for resolution. More... | |
virtual | ~PointerAnalysis () |
Destructor. More... | |
void | printIndCSTargets (const CallICFGNode *cs, const FunctionSet &targets) |
Print targets of a function pointer. More... | |
virtual void | dumpAllPts () |
virtual void | dumpPts (NodeID ptr, const PointsTo &pts) |
void | printIndCSTargets () |
void | dumpAllTypes () |
void | dumpStat () |
Dump the statistics. More... | |
bool | containBlackHoleNode (const PointsTo &pts) |
Determine whether a points-to contains a black hole or constant node. More... | |
bool | containConstantNode (const PointsTo &pts) |
virtual bool | isBlkObjOrConstantObj (NodeID ptd) const |
bool | isHeapMemObj (NodeID id) const |
Whether this object is heap or array. More... | |
bool | isArrayMemObj (NodeID id) const |
bool | isFIObjNode (NodeID id) const |
NodeID | getBaseObjVar (NodeID id) |
NodeID | getFIObjVar (NodeID id) |
NodeID | getGepObjVar (NodeID id, const APOffset &ap) |
virtual const NodeBS & | getAllFieldsObjVars (NodeID id) |
void | setObjFieldInsensitive (NodeID id) |
bool | isFieldInsensitive (NodeID id) const |
Public Member Functions inherited from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem > | |
DDAVFSolver () | |
Constructor. More... | |
virtual | ~DDAVFSolver () |
Destructor. More... | |
NodeBS & | getCandidateQueries () |
Return candidate pointers for DDA. More... | |
virtual CxtLocDPItem | getDPIm (const CxtVar &var, const SVFGNode *loc) const |
Given CVar and location (SVFGNode) return a new DPItem. More... | |
virtual bool | unionDDAPts (CxtPtSet &pts, const CxtPtSet &targetPts) |
Union pts. More... | |
virtual bool | unionDDAPts (CxtLocDPItem dpm, const CxtPtSet &targetPts) |
Union pts. More... | |
virtual void | addDDAPts (CxtPtSet &pts, const CxtVar &var) |
Add pts. More... | |
SVFG * | getSVFG () const |
Return SVFG. More... | |
SVFGSCC * | getSVFGSCC () const |
Return SVFGSCC. More... | |
void | dumpCPtSet (const CxtPtSet &cpts) const |
virtual const CxtPtSet & | findPT (const CxtLocDPItem &dpm) |
Compute points-to. More... | |
Private Attributes | |
ConstSVFGEdgeSet | insensitveEdges |
insensitive call-return edges More... | |
FlowDDA * | flowDDA |
downgrade to flowDDA if out-of-budget More... | |
DDAClient * | _client |
DDA client. More... | |
Additional Inherited Members | |
Public Types inherited from SVF::CondPTAImpl< ContextCond > | |
typedef CondVar< ContextCond > | CVar |
typedef CondStdSet< CVar > | CPtSet |
typedef PTData< CVar, Set< CVar >, CVar, CPtSet > | PTDataTy |
typedef MutablePTData< CVar, Set< CVar >, CVar, CPtSet > | MutPTDataTy |
typedef Map< NodeID, PointsTo > | PtrToBVPtsMap |
typedef Map< NodeID, NodeSet > | PtrToNSMap |
map a pointer to its BitVector points-to representation More... | |
typedef Map< NodeID, CPtSet > | PtrToCPtsMap |
Public Types inherited from SVF::PointerAnalysis | |
enum | PTATY { Andersen_BASE , Andersen_WPA , AndersenSCD_WPA , AndersenSFR_WPA , AndersenWaveDiff_WPA , Steensgaard_WPA , CSCallString_WPA , CSSummary_WPA , FSDATAFLOW_WPA , FSSPARSE_WPA , VFS_WPA , FSCS_WPA , CFLFICI_WPA , CFLFSCI_WPA , CFLFSCS_WPA , TypeCPP_WPA , FieldS_DDA , FlowS_DDA , PathS_DDA , Cxt_DDA , Default_PTA } |
Pointer analysis type list. More... | |
enum | PTAImplTy { BaseImpl , BVDataImpl , CondImpl } |
Implementation type: BVDataPTAImpl or CondPTAImpl. More... | |
typedef Set< const CallICFGNode * > | CallSiteSet |
Indirect call edges type, map a callsite to a set of callees. More... | |
typedef SVFIR::CallSiteToFunPtrMap | CallSiteToFunPtrMap |
typedef Set< const SVFFunction * > | FunctionSet |
typedef OrderedMap< const CallICFGNode *, FunctionSet > | CallEdgeMap |
typedef SCCDetection< PTACallGraph * > | CallGraphSCC |
typedef Set< const SVFGlobalValue * > | VTableSet |
typedef Set< const SVFFunction * > | VFunSet |
Public Types inherited from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem > | |
typedef SCCDetection< SVFG * > | SVFGSCC |
typedef SCCDetection< PTACallGraph * > | CallGraphSCC |
typedef PTACallGraphEdge::CallInstSet | CallInstSet |
typedef SVFIR::CallSiteSet | CallSiteSet |
typedef OrderedSet< CxtLocDPItem > | DPTItemSet |
typedef OrderedMap< CxtLocDPItem, CxtPtSet > | DPImToCPtSetMap |
typedef OrderedMap< CxtLocDPItem, CxtVar > | DPMToCVarMap |
typedef OrderedMap< CxtLocDPItem, CxtLocDPItem > | DPMToDPMMap |
typedef OrderedMap< NodeID, DPTItemSet > | LocToDPMVecMap |
typedef OrderedSet< const SVFGEdge * > | ConstSVFGEdgeSet |
typedef SVFGEdge::SVFGEdgeSetTy | SVFGEdgeSet |
typedef OrderedMap< const SVFGNode *, DPTItemSet > | StoreToPMSetMap |
Static Public Member Functions inherited from SVF::CondPTAImpl< ContextCond > | |
static bool | classof (const PointerAnalysis *pta) |
Static Public Attributes inherited from SVF::PointerAnalysis | |
static const std::string | aliasTestMayAlias = "MAYALIAS" |
static const std::string | aliasTestMayAliasMangled = "_Z8MAYALIASPvS_" |
static const std::string | aliasTestNoAlias = "NOALIAS" |
static const std::string | aliasTestNoAliasMangled = "_Z7NOALIASPvS_" |
static const std::string | aliasTestPartialAlias = "PARTIALALIAS" |
static const std::string | aliasTestPartialAliasMangled = "_Z12PARTIALALIASPvS_" |
static const std::string | aliasTestMustAlias = "MUSTALIAS" |
static const std::string | aliasTestMustAliasMangled = "_Z9MUSTALIASPvS_" |
static const std::string | aliasTestFailMayAlias = "EXPECTEDFAIL_MAYALIAS" |
static const std::string | aliasTestFailMayAliasMangled = "_Z21EXPECTEDFAIL_MAYALIASPvS_" |
static const std::string | aliasTestFailNoAlias = "EXPECTEDFAIL_NOALIAS" |
static const std::string | aliasTestFailNoAliasMangled = "_Z20EXPECTEDFAIL_NOALIASPvS_" |
Protected Member Functions inherited from SVF::CondPTAImpl< ContextCond > | |
virtual bool | unionPts (CVar id, const CPtSet &target) |
virtual bool | unionPts (CVar id, CVar ptd) |
virtual bool | addPts (CVar id, CVar ptd) |
bool | mustAlias (const CVar &var1, const CVar &var2) |
Internal interface to be used for conditional points-to set queries. More... | |
bool | contains (const CPtSet &cpts1, const CPtSet &cpts2) |
bool | isSameVar (const CVar &var1, const CVar &var2) const |
Whether two pointers/objects are the same one by considering their conditions. More... | |
virtual void | normalizePointsTo () |
Normalize points-to information to BitVector/conditional representation. More... | |
Protected Member Functions inherited from SVF::PointerAnalysis | |
const CallSiteToFunPtrMap & | getIndirectCallsites () const |
Return all indirect callsites. More... | |
NodeID | getFunPtr (const CallICFGNode *cs) const |
Return function pointer PAGNode at a callsite cs. More... | |
virtual void | validateTests () |
Alias check functions to verify correctness of pointer analysis. More... | |
virtual void | validateSuccessTests (std::string fun) |
virtual void | validateExpectedFailureTests (std::string fun) |
void | resetObjFieldSensitive () |
Reset all object node as field-sensitive. More... | |
Protected Member Functions inherited from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem > | |
virtual void | handleSingleStatement (const CxtLocDPItem &dpm, CxtPtSet &pts) |
Handle single statement. More... | |
void | reCompute (const CxtLocDPItem &dpm) |
recompute points-to for value-flow cycles and indirect calls More... | |
void | reComputeForEdges (const CxtLocDPItem &dpm, const SVFGEdgeSet &edgeSet, bool indirectCall=false) |
Traverse along out edges to find all nodes which may be affected by locDPM. More... | |
virtual void | buildSVFG (SVFIR *pag) |
Build SVFG. More... | |
virtual void | resetQuery () |
Reset visited map for next points-to query. More... | |
void | OOBResetVisited () |
Reset visited map if the current query is out-of-budget. More... | |
const SVFGNode * | getDefSVFGNode (const PAGNode *pagNode) const |
GetDefinition SVFG. More... | |
void | backtraceAlongIndirectVF (CxtPtSet &pts, const CxtLocDPItem &oldDpm) |
Backward traverse along indirect value flows. More... | |
void | backtraceAlongDirectVF (CxtPtSet &pts, const CxtLocDPItem &oldDpm) |
Backward traverse along direct value flows. More... | |
void | startNewPTCompFromLoadSrc (CxtPtSet &pts, const CxtLocDPItem &oldDpm) |
void | startNewPTCompFromStoreDst (CxtPtSet &pts, const CxtLocDPItem &oldDpm) |
void | backtraceToStoreSrc (CxtPtSet &pts, const CxtLocDPItem &oldDpm) |
virtual void | backwardPropDpm (CxtPtSet &pts, NodeID ptr, const CxtLocDPItem &oldDpm, const SVFGEdge *edge) |
dpm transit during backward tracing More... | |
virtual bool | isMustAlias (const CxtLocDPItem &, const CxtLocDPItem &) |
whether load and store are aliased More... | |
virtual bool | isStrongUpdate (const CxtPtSet &dstCPSet, const StoreSVFGNode *store) |
Return TRUE if this is a strong update STORE statement. More... | |
virtual bool | isLocalCVarInRecursion (const CxtVar &var) const |
Whether a local variable is in function recursions. More... | |
void | resolveFunPtr (const CxtLocDPItem &dpm) |
resolve function pointer More... | |
void | markbkVisited (const CxtLocDPItem &dpm) |
Visited flags to avoid cycles. More... | |
bool | isbkVisited (const CxtLocDPItem &dpm) |
void | clearbkVisited (const CxtLocDPItem &dpm) |
virtual const CxtPtSet & | getCachedPointsTo (const CxtLocDPItem &dpm) |
Points-to Caching for top-level pointers and address-taken objects. More... | |
virtual void | updateCachedPointsTo (const CxtLocDPItem &dpm, const CxtPtSet &pts) |
virtual const CxtPtSet & | getCachedTLPointsTo (const CxtLocDPItem &dpm) |
virtual const CxtPtSet & | getCachedADPointsTo (const CxtLocDPItem &dpm) |
bool | isTopLevelPtrStmt (const SVFGNode *stmt) |
Whether this is a top-level pointer statement. More... | |
virtual CxtLocDPItem | getDPImWithOldCond (const CxtLocDPItem &oldDpm, const CxtVar &var, const SVFGNode *loc) |
Return dpm with old context and path conditions. More... | |
void | SVFGSCCDetection () |
SVFG SCC detection. More... | |
NodeID | getSVFGSCCRepNode (NodeID id) |
Get SCC rep node of a SVFG node. More... | |
bool | isSVFGNodeInCycle (const SVFGNode *node) |
Return whether this SVFGNode is in cycle. More... | |
bool | edgeInSVFGSCC (const SVFGEdge *edge) |
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the SVFG. More... | |
void | setCallGraph (PTACallGraph *cg) |
Set callgraph. More... | |
void | setCallGraphSCC (CallGraphSCC *scc) |
Set callgraphSCC. More... | |
bool | isArrayCondMemObj (const CxtVar &var) const |
bool | isFieldInsenCondMemObj (const CxtVar &var) const |
void | addLoadDpmAndCVar (const CxtLocDPItem &dpm, const CxtLocDPItem &loadDpm, const CxtVar &loadVar) |
LoadDpm for must-alias analysis. More... | |
void | addLoadDpm (const CxtLocDPItem &dpm, const CxtLocDPItem &loadDpm) |
Note that simply use "dpmToloadDpmMap[dpm]=loadDpm", requires DPIm have a default constructor. More... | |
const CxtLocDPItem & | getLoadDpm (const CxtLocDPItem &dpm) const |
void | addLoadCVar (const CxtLocDPItem &dpm, const CxtVar &loadVar) |
const CxtVar & | getLoadCVar (const CxtLocDPItem &dpm) const |
AndersenWaveDiff * | getAndersenAnalysis () const |
Return Andersen's analysis. More... | |
void | handleOutOfBudgetDpm (const CxtLocDPItem &dpm) |
handle out-of-budget queries More... | |
bool | testOutOfBudget (const CxtLocDPItem &dpm) |
bool | isOutOfBudgetQuery () const |
void | addOutOfBudgetDpm (const CxtLocDPItem &dpm) |
bool | isOutOfBudgetDpm (const CxtLocDPItem &dpm) const |
DDAStat * | setDDAStat (DDAStat *s) |
Set DDAStat. More... | |
void | addSUStat (const CxtLocDPItem &dpm, const SVFGNode *node) |
stat strong updates num More... | |
void | rmSUStat (const CxtLocDPItem &dpm, const SVFGNode *node) |
remove strong updates num if the dpm goes to weak updates branch More... | |
Protected Attributes inherited from SVF::CondPTAImpl< ContextCond > | |
PTDataTy * | ptD |
Points-to data. More... | |
bool | normalized |
Normalized flag. More... | |
PtrToBVPtsMap | ptrToBVPtsMap |
Normal points-to representation (without conditions) More... | |
PtrToNSMap | objToNSRevPtsMap |
Normal points-to representation (without conditions) More... | |
PtrToCPtsMap | ptrToCPtsMap |
Conditional points-to representation (with conditions) More... | |
Protected Attributes inherited from SVF::PointerAnalysis | |
bool | print_stat |
User input flags. More... | |
bool | alias_validation |
Flag for validating points-to/alias results. More... | |
u32_t | OnTheFlyIterBudgetForStat |
Flag for iteration budget for on-the-fly statistics. More... | |
SVFModule * | svfMod |
Module. More... | |
PTATY | ptaTy |
Pointer analysis Type. More... | |
PTAImplTy | ptaImplTy |
PTA implementation type. More... | |
PTAStat * | stat |
Statistics. More... | |
PTACallGraph * | callgraph |
Call graph used for pointer analysis. More... | |
CallGraphSCC * | callGraphSCC |
SCC for PTACallGraph. More... | |
ICFG * | icfg |
Interprocedural control-flow graph. More... | |
CommonCHGraph * | chgraph |
CHGraph. More... | |
Protected Attributes inherited from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem > | |
bool | outOfBudgetQuery |
Whether the current query is out of step limits. More... | |
SVFIR * | _pag |
SVFIR. More... | |
SVFG * | _svfg |
SVFG. More... | |
AndersenWaveDiff * | _ander |
Andersen's analysis. More... | |
NodeBS | candidateQueries |
candidate pointers; More... | |
PTACallGraph * | _callGraph |
PTACallGraph. More... | |
CallGraphSCC * | _callGraphSCC |
SCC for PTACallGraph. More... | |
SVFGSCC * | _svfgSCC |
SCC for SVFG. More... | |
DPTItemSet | backwardVisited |
visited map during backward traversing More... | |
DPImToCPtSetMap | dpmToTLCPtSetMap |
points-to caching map for top-level vars More... | |
DPImToCPtSetMap | dpmToADCPtSetMap |
points-to caching map for address-taken vars More... | |
LocToDPMVecMap | locToDpmSetMap |
map location to its dpms More... | |
DPMToDPMMap | dpmToloadDpmMap |
dpms at loads for may/must-alias analysis with stores More... | |
DPMToCVarMap | loadToPTCVarMap |
map a load dpm to its cvar pointed by its pointer operand More... | |
DPTItemSet | outOfBudgetDpms |
out of budget dpm set More... | |
StoreToPMSetMap | storeToDPMs |
map store to set of DPM which have been stong updated there More... | |
DDAStat * | ddaStat |
DDA stat. More... | |
SVFGBuilder | svfgBuilder |
SVFG Builder. More... | |
Static Protected Attributes inherited from SVF::PointerAnalysis | |
static SVFIR * | pag = nullptr |
SVFIR. More... | |
Context-, Flow- Sensitive Demand-driven Analysis
Definition at line 54 of file ContextDDA.h.
Constructor.
Constructor
Definition at line 42 of file ContextDDA.cpp.
|
virtual |
|
inlineoverridevirtual |
Compute points-to set for a context-sensitive pointer.
Compute points-to set for a context-sensitive pointer
Definition at line 75 of file ContextDDA.cpp.
|
overridevirtual |
Compute points-to set for an unconditional pointer.
Compute points-to set for an unconditional pointer
Reimplemented from SVF::PointerAnalysis.
Definition at line 105 of file ContextDDA.cpp.
|
inlinevirtual |
|
inline |
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the SVFG.
Definition at line 160 of file ContextDDA.h.
|
inlineoverridevirtual |
Finalize analysis.
Reimplemented from SVF::CondPTAImpl< ContextCond >.
Definition at line 68 of file ContextDDA.h.
|
inlineoverridevirtual |
Override parent method.
Implements SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 86 of file ContextDDA.h.
CallSiteID ContextDDA::getCSIDAtCall | ( | CxtLocDPItem & | dpm, |
const SVFGEdge * | edge | ||
) |
get callsite id from call, return 0 if it is a spurious call edge
get callsite id from call, return 0 if it is a spurious call edge translate the callsite id from pre-computed callgraph on SVFG to the one on current callgraph
Definition at line 210 of file ContextDDA.cpp.
CallSiteID ContextDDA::getCSIDAtRet | ( | CxtLocDPItem & | dpm, |
const SVFGEdge * | edge | ||
) |
get callsite id from return, return 0 if it is a spurious return edge
get callsite id from return, return 0 if it is a spurious return edge translate the callsite id from pre-computed callgraph on SVFG to the one on current callgraph
Definition at line 234 of file ContextDDA.cpp.
|
inline |
Return insensitive edge set.
Definition at line 207 of file ContextDDA.h.
Override parent method.
Implements SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 100 of file ContextDDA.h.
|
inlineoverridevirtual |
Handle Address SVFGNode to add proper conditional points-to.
whether this object is set field-insensitive during pre-analysis
Implements SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 177 of file ContextDDA.h.
|
overridevirtual |
Handle condition for context or path analysis (backward analysis)
Handle conditions during backward traversing.
we don't handle context in recursions, they treated as assignments
we don't handle context in recursions, they treated as assignments
TODO: When this call site id is contained in current call string, we may find a recursion. Try to solve this later.
Reimplemented from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 256 of file ContextDDA.cpp.
void ContextDDA::handleOutOfBudgetDpm | ( | const CxtLocDPItem & | dpm | ) |
Handle out-of-budget dpm.
Handle out-of-budget dpm
Definition at line 115 of file ContextDDA.cpp.
|
overridevirtual |
Initialization of the analysis.
Analysis initialization
Reimplemented from SVF::PointerAnalysis.
Definition at line 62 of file ContextDDA.cpp.
|
inlineoverridevirtual |
Whether two call string contexts are compatible which may represent the same memory object compare with call strings from last few callsite ids (most recent ids to objects): compatible : (e.g., 123 == 123, 123 == 23). not compatible (e.g., 123 != 423)
context conditions of local(not in recursion) and global variables are compatible
Implements SVF::CondPTAImpl< ContextCond >.
Definition at line 136 of file ContextDDA.cpp.
|
inlinevirtual |
Whether call/return inside recursion.
Definition at line 134 of file ContextDDA.h.
|
overridevirtual |
we exclude concrete heap given the following conditions: (1) concrete calling context (not involved in recursion and not exceed the maximum context limit) (2) not inside loop
Reimplemented from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 335 of file ContextDDA.cpp.
|
inline |
Whether this edge is treated context-insensitively.
Definition at line 202 of file ContextDDA.h.
|
inlinevirtual |
|
overridevirtual |
processGep node
Generate field objects for structs
Implements SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 154 of file ContextDDA.cpp.
|
inlineoverridevirtual |
Propagate along indirect value-flow if two objects of load and store are same.
Reimplemented from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 191 of file ContextDDA.h.
|
inlineoverridevirtual |
Return PTA name.
Reimplemented from SVF::PointerAnalysis.
Definition at line 217 of file ContextDDA.h.
bool ContextDDA::testIndCallReachability | ( | CxtLocDPItem & | dpm, |
const SVFFunction * | callee, | ||
const CallICFGNode * | cs | ||
) |
refine indirect call edge
Definition at line 189 of file ContextDDA.cpp.
|
inlineoverridevirtual |
Update call graph.
Reimplemented from SVF::DDAVFSolver< CxtVar, CxtPtSet, CxtLocDPItem >.
Definition at line 142 of file ContextDDA.h.
|
private |
DDA client.
Definition at line 225 of file ContextDDA.h.
|
private |
downgrade to flowDDA if out-of-budget
Definition at line 224 of file ContextDDA.h.
|
private |
insensitive call-return edges
Definition at line 223 of file ContextDDA.h.