|
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 | ~PointerAnalysis () |
| Destructor. | |
| 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. | |
| virtual NodeBS | getMayAliases (NodeID node) |
| 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_" |
| 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 255 of file PointerAnalysisImpl.h.
| typedef CondStdSet<CVar> SVF::CondPTAImpl< Cond >::CPtSet |
Definition at line 260 of file PointerAnalysisImpl.h.
| typedef CondVar<Cond> SVF::CondPTAImpl< Cond >::CVar |
Definition at line 259 of file PointerAnalysisImpl.h.
| typedef MutablePTData<CVar, Set<CVar>, CVar, CPtSet> SVF::CondPTAImpl< Cond >::MutPTDataTy |
Definition at line 262 of file PointerAnalysisImpl.h.
| typedef PTData<CVar, Set<CVar>, CVar, CPtSet> SVF::CondPTAImpl< Cond >::PTDataTy |
Definition at line 261 of file PointerAnalysisImpl.h.
| typedef Map<NodeID,PointsTo> SVF::CondPTAImpl< Cond >::PtrToBVPtsMap |
Definition at line 263 of file PointerAnalysisImpl.h.
| typedef Map<NodeID,CPtSet> SVF::CondPTAImpl< Cond >::PtrToCPtsMap |
Definition at line 265 of file PointerAnalysisImpl.h.
| typedef Map<NodeID, NodeSet> SVF::CondPTAImpl< Cond >::PtrToNSMap |
map a pointer to its BitVector points-to representation
Definition at line 264 of file PointerAnalysisImpl.h.
|
inline |
map a pointer to its conditional points-to set
Constructor
Definition at line 268 of file PointerAnalysisImpl.h.
|
inlinevirtual |
|
inlineprotectedvirtual |
Definition at line 392 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given two conditional points-to sets.
Definition at line 530 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given conditional variables.
Definition at line 525 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given Value infos.
Implements SVF::PointerAnalysis.
Definition at line 515 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Interface expose to users of our pointer analysis, given two pointers.
Implements SVF::PointerAnalysis.
Definition at line 520 of file PointerAnalysisImpl.h.
|
inlinestatic |
Definition at line 284 of file PointerAnalysisImpl.h.
|
inlinevirtual |
|
inline |
Test blk node for cpts.
Definition at line 548 of file PointerAnalysisImpl.h.
|
inline |
|
inlineprotected |
Definition at line 415 of file PointerAnalysisImpl.h.
|
inline |
Release memory.
Definition at line 290 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Print out conditional pts.
Reimplemented from SVF::PointerAnalysis.
Definition at line 483 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Dump points-to information of top-level pointers.
Reimplemented from SVF::PointerAnalysis.
Definition at line 571 of file PointerAnalysisImpl.h.
|
inline |
Expand all fields of an aggregate in all points-to sets.
Definition at line 354 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 374 of file PointerAnalysisImpl.h.
|
inlinevirtual |
|
inlinevirtual |
Given a pointer return its conditional points-to.
Definition at line 502 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 302 of file PointerAnalysisImpl.h.
|
inline |
Get points-to data.
Definition at line 297 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Get points-to and reverse points-to
Definition at line 323 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Given a pointer return its bit vector points-to.
Implements SVF::PointerAnalysis.
Definition at line 496 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 314 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Definition at line 327 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Given an object return all pointers points to this object.
Implements SVF::PointerAnalysis.
Definition at line 508 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 309 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 438 of file PointerAnalysisImpl.h.
|
inlineprotected |
Internal interface to be used for conditional points-to set queries.
Definition at line 400 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Normalize points-to information to BitVector/conditional representation.
Definition at line 450 of file PointerAnalysisImpl.h.
|
inline |
Whether cpts1 and cpts2 have overlap points-to targets.
Definition at line 340 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 382 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Definition at line 387 of file PointerAnalysisImpl.h.
|
protected |
Normalized flag.
Definition at line 474 of file PointerAnalysisImpl.h.
|
protected |
Normal points-to representation (without conditions).
Definition at line 478 of file PointerAnalysisImpl.h.
|
protected |
Points-to data.
Definition at line 472 of file PointerAnalysisImpl.h.
|
protected |
Normal points-to representation (without conditions).
Definition at line 476 of file PointerAnalysisImpl.h.
|
protected |
Conditional points-to representation (with conditions).
Definition at line 480 of file PointerAnalysisImpl.h.