|
Static Value-Flow Analysis
|
#include <PointerAnalysisImpl.h>
Public Types | |
| typedef CondVar< Cond > | 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 | |
| typedef Map< NodeID, CPtSet > | PtrToCPtsMap |
Public Types inherited from SVF::PointerAnalysis | |
| typedef Set< const CallICFGNode * > | CallSiteSet |
| Indirect call edges type, map a callsite to a set of callees. | |
| typedef SVFIR::CallSiteToFunPtrMap | CallSiteToFunPtrMap |
| typedef Set< const FunObjVar * > | FunctionSet |
| typedef OrderedMap< const CallICFGNode *, FunctionSet > | CallEdgeMap |
| typedef SCCDetection< CallGraph * > | CallGraphSCC |
| typedef Set< const GlobalObjVar * > | VTableSet |
| typedef Set< const FunObjVar * > | VFunSet |
Public Member Functions | |
| CondPTAImpl (SVFIR *pag, PTATY type) | |
| map a pointer to its conditional points-to set | |
| virtual | ~CondPTAImpl () |
| Destructor. | |
| void | destroy () |
| Release memory. | |
| PTDataTy * | getPTDataTy () const |
| Get points-to data. | |
| MutPTDataTy * | getMutPTDataTy () const |
| bool | hasPtsMap (void) const |
| const MutPTDataTy::PtsMap & | getPtsMap () const |
Public Member Functions inherited from SVF::PointerAnalysis | |
| ICFG * | getICFG () const |
| Get ICFG. | |
| u32_t | getNumOfResolvedIndCallEdge () const |
| Return number of resolved indirect call edges. | |
| CallGraph * | getCallGraph () const |
| Return call graph. | |
| CallGraphSCC * | getCallGraphSCC () const |
| Return call graph SCC. | |
| PointerAnalysis (SVFIR *pag, PTATY ty=PTATY::Default_PTA, bool alias_check=true) | |
| Constructor. | |
| PTATY | getAnalysisTy () const |
| Type of pointer analysis. | |
| PTAImplTy | getImplTy () const |
| Return implementation type of the pointer analysis. | |
| bool | printStat () |
| Whether print statistics. | |
| void | disablePrintStat () |
| Whether print statistics. | |
| CallEdgeMap & | getIndCallMap () |
| Get callees from an indirect callsite. | |
| 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. | |
| void | callGraphSCCDetection () |
| PTACallGraph SCC related methods. | |
| NodeID | getCallGraphSCCRepNode (NodeID id) const |
| Get SCC rep node of a SVFG node. | |
| bool | inSameCallGraphSCC (const FunObjVar *fun1, const FunObjVar *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. | |
| bool | isInRecursion (const FunObjVar *fun) const |
| bool | isLocalVarInRecursiveFun (NodeID id) const |
| Whether a local variable is in function recursions. | |
| virtual const std::string | PTAName () const |
| Return PTA name. | |
| CommonCHGraph * | getCHGraph () const |
| get CHGraph | |
| 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. | |
| SVFIR * | getPAG () const |
| PTAStat * | getStat () const |
| Get PTA stat. | |
| OrderedNodeSet & | getAllValidPtrs () |
| Get all Valid Pointers for resolution. | |
| virtual void | initialize () |
| Initialization of a pointer analysis, including building symbol table and SVFIR etc. | |
| virtual void | analyze ()=0 |
| Start Analysis here (main part of pointer analysis). It needs to be implemented in child class. | |
| virtual void | computeDDAPts (NodeID) |
| Compute points-to results on-demand, overridden by derived classes. | |
| bool | mayAlias (const SVFVar *V1, const SVFVar *V2) |
| Convenience bool wrappers: return true if the two operands may/must/partial alias. | |
| bool | mayAlias (NodeID node1, NodeID node2) |
| void | printIndCSTargets (const CallICFGNode *cs, const FunctionSet &targets) |
| Print targets of a function pointer. | |
| virtual void | dumpAllPts () |
| virtual void | dumpPts (NodeID ptr, const PointsTo &pts) |
| void | printIndCSTargets () |
| void | dumpAllTypes () |
| void | dumpStat () |
| Dump the statistics. | |
| bool | containBlackHoleNode (const PointsTo &pts) |
| Determine whether a points-to contains a black hole or constant node. | |
| bool | containConstantNode (const PointsTo &pts) |
| virtual bool | isBlkObjOrConstantObj (NodeID ptd) const |
| bool | isHeapMemObj (NodeID id) const |
| Whether this object is heap or array. | |
| bool | isArrayMemObj (NodeID id) const |
| bool | isFIObjNode (NodeID id) const |
| NodeID | getBaseObjVarID (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 |
Static Public Member Functions | |
| static bool | classof (const PointerAnalysis *pta) |
| PTDataTy * | ptD |
| Points-to data. | |
| bool | normalized |
| Normalized flag. | |
| PtrToBVPtsMap | ptrToBVPtsMap |
| Normal points-to representation (without conditions) | |
| PtrToNSMap | objToNSRevPtsMap |
| Normal points-to representation (without conditions) | |
| PtrToCPtsMap | ptrToCPtsMap |
| Conditional points-to representation (with conditions) | |
| virtual const CPtSet & | getPts (CVar id) |
| virtual const Set< CVar > & | getRevPts (CVar nodeId) |
| virtual void | clearPts () |
| Clear all data. | |
| bool | overlap (const CPtSet &cpts1, const CPtSet &cpts2) const |
| Whether cpts1 and cpts2 have overlap points-to targets. | |
| void | expandFIObjs (const CPtSet &cpts, CPtSet &expandedCpts) |
| Expand all fields of an aggregate in all points-to sets. | |
| virtual void | dumpCPts () |
| Print out conditional pts. | |
| virtual PointsTo | getBVPointsTo (const CPtSet &cpts) const |
| Given a conditional pts return its bit vector points-to. | |
| virtual PointsTo & | getPts (NodeID ptr) |
| Given a pointer return its bit vector points-to. | |
| virtual const CPtSet & | getCondPointsTo (NodeID ptr) |
| Given a pointer return its conditional points-to. | |
| virtual NodeSet & | getRevPts (NodeID obj) |
| Given an object return all pointers points to this object. | |
| virtual AliasResult | alias (const SVFVar *V1, const SVFVar *V2) |
| Interface expose to users of our pointer analysis, given Value infos. | |
| virtual AliasResult | alias (NodeID node1, NodeID node2) |
| Interface expose to users of our pointer analysis, given two pointers. | |
| virtual AliasResult | alias (const CVar &var1, const CVar &var2) |
| Interface expose to users of our pointer analysis, given conditional variables. | |
| virtual AliasResult | alias (const CPtSet &pts1, const CPtSet &pts2) |
| Interface expose to users of our pointer analysis, given two conditional points-to sets. | |
| bool | containBlackHoleNode (const CPtSet &cpts) |
| Test blk node for cpts. | |
| bool | containConstantNode (const CPtSet &cpts) |
| Test constant node for cpts. | |
| virtual bool | isCondCompatible (const Cond &cxt1, const Cond &cxt2, bool singleton) const =0 |
| Whether two conditions are compatible (to be implemented by child class) | |
| void | dumpTopLevelPtsTo () |
| Dump points-to information of top-level pointers. | |
| virtual void | finalize () |
| Finalization of pointer analysis, and normalize points-to information to Bit Vector representation. | |
| 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. | |
| 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. | |
| virtual void | normalizePointsTo () |
| Normalize points-to information to BitVector/conditional representation. | |
Additional Inherited Members | |
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::PointerAnalysis | |
| const CallSiteToFunPtrMap & | getIndirectCallsites () const |
| Return all indirect callsites. | |
| NodeID | getFunPtr (const CallICFGNode *cs) const |
| Return function pointer PAGNode at a callsite cs. | |
| virtual void | validateTests () |
| Alias check functions to verify correctness of pointer analysis. | |
| virtual void | validateSuccessTests (std::string fun) |
| virtual void | validateExpectedFailureTests (std::string fun) |
| void | resetObjFieldSensitive () |
| Reset all object node as field-sensitive. | |
Protected Attributes inherited from SVF::PointerAnalysis | |
| bool | print_stat |
| User input flags. | |
| bool | alias_validation |
| Flag for validating points-to/alias results. | |
| u32_t | OnTheFlyIterBudgetForStat |
| Flag for iteration budget for on-the-fly statistics. | |
| PTATY | ptaTy |
| Pointer analysis Type. | |
| PTAImplTy | ptaImplTy |
| PTA implementation type. | |
| PTAStat * | stat |
| Statistics. | |
| CallGraph * | callgraph |
| Call graph used for pointer analysis. | |
| CallGraphSCC * | callGraphSCC |
| SCC for PTACallGraph. | |
| ICFG * | icfg |
| Interprocedural control-flow graph. | |
| CommonCHGraph * | chgraph |
| CHGraph. | |
Static Protected Attributes inherited from SVF::PointerAnalysis | |
| static SVFIR * | pag = nullptr |
| SVFIR. | |
Pointer analysis implementation which uses conditional points-to map data structure (context/path sensitive analysis)
Definition at line 251 of file PointerAnalysisImpl.h.
| typedef CondStdSet<CVar> SVF::CondPTAImpl< Cond >::CPtSet |
Definition at line 256 of file PointerAnalysisImpl.h.
Definition at line 255 of file PointerAnalysisImpl.h.
| typedef MutablePTData<CVar, Set<CVar>, CVar, CPtSet> SVF::CondPTAImpl< Cond >::MutPTDataTy |
Definition at line 258 of file PointerAnalysisImpl.h.
Definition at line 257 of file PointerAnalysisImpl.h.
Definition at line 259 of file PointerAnalysisImpl.h.
Definition at line 261 of file PointerAnalysisImpl.h.
map a pointer to its BitVector points-to representation
Definition at line 260 of file PointerAnalysisImpl.h.
map a pointer to its conditional points-to set
Constructor
Definition at line 264 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Definition at line 388 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given two conditional points-to sets.
Definition at line 526 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given conditional variables.
Definition at line 521 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given Value infos.
Implements SVF::PointerAnalysis.
Definition at line 511 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given two pointers.
Implements SVF::PointerAnalysis.
Definition at line 516 of file PointerAnalysisImpl.h.
|
inlinestatic |
Definition at line 280 of file PointerAnalysisImpl.h.
|
inlinevirtual |
|
inline |
Test blk node for cpts.
Definition at line 544 of file PointerAnalysisImpl.h.
|
inline |
Test constant node for cpts.
Definition at line 554 of file PointerAnalysisImpl.h.
|
inlineprotected |
Definition at line 411 of file PointerAnalysisImpl.h.
|
inline |
Release memory.
Definition at line 286 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Print out conditional pts.
Reimplemented from SVF::PointerAnalysis.
Definition at line 479 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Dump points-to information of top-level pointers.
Reimplemented from SVF::PointerAnalysis.
Definition at line 567 of file PointerAnalysisImpl.h.
|
inline |
Expand all fields of an aggregate in all points-to sets.
Definition at line 350 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Finalization of pointer analysis, and normalize points-to information to Bit Vector representation.
Reimplemented from SVF::PointerAnalysis.
Reimplemented in SVF::ContextDDA.
Definition at line 370 of file PointerAnalysisImpl.h.
Given a pointer return its conditional points-to.
Definition at line 498 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 298 of file PointerAnalysisImpl.h.
|
inline |
Get points-to data.
Definition at line 293 of file PointerAnalysisImpl.h.
Get points-to and reverse points-to
Definition at line 319 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Given a pointer return its bit vector points-to.
Implements SVF::PointerAnalysis.
Definition at line 492 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 310 of file PointerAnalysisImpl.h.
Definition at line 323 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Given an object return all pointers points to this object.
Implements SVF::PointerAnalysis.
Definition at line 504 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 305 of file PointerAnalysisImpl.h.
|
pure virtual |
Whether two conditions are compatible (to be implemented by child class)
Implemented in SVF::ContextDDA.
|
inlineprotected |
Whether two pointers/objects are the same one by considering their conditions.
we distinguish context sensitive memory allocation here
Definition at line 434 of file PointerAnalysisImpl.h.
Internal interface to be used for conditional points-to set queries.
Definition at line 396 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Normalize points-to information to BitVector/conditional representation.
Definition at line 446 of file PointerAnalysisImpl.h.
Whether cpts1 and cpts2 have overlap points-to targets.
Definition at line 336 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Union/add points-to, and add the reverse points-to for node collapse purpose To be noted that adding reverse pts might incur 10% total overhead during solving
Definition at line 378 of file PointerAnalysisImpl.h.
Definition at line 383 of file PointerAnalysisImpl.h.
|
protected |
Normalized flag.
Definition at line 470 of file PointerAnalysisImpl.h.
|
protected |
Normal points-to representation (without conditions)
Definition at line 474 of file PointerAnalysisImpl.h.
|
protected |
Points-to data.
Definition at line 468 of file PointerAnalysisImpl.h.
|
protected |
Normal points-to representation (without conditions)
Definition at line 472 of file PointerAnalysisImpl.h.
|
protected |
Conditional points-to representation (with conditions)
Definition at line 476 of file PointerAnalysisImpl.h.