|
Static Value-Flow Analysis
|
#include <PointerAnalysisImpl.h>
Public Member Functions | |
| BVDataPTAImpl (SVFIR *pag, PTATY type, bool alias_check=true) | |
| Constructor. | |
| ~BVDataPTAImpl () override=default | |
| Destructor. | |
| PersistentPointsToCache< PointsTo > & | getPtCache () |
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 | 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) |
| std::unique_ptr< PTDataTy > | ptD |
| Points-to data. | |
| PersistentPointsToCache< PointsTo > | ptCache |
| const PointsTo & | getPts (NodeID id) override |
| const NodeSet & | getRevPts (NodeID nodeId) override |
| virtual void | clearPts (NodeID id, NodeID element) |
| Remove element from the points-to set of id. | |
| virtual void | clearFullPts (NodeID id) |
| Clear points-to set of id. | |
| virtual bool | unionPts (NodeID id, const PointsTo &target) |
| virtual bool | unionPts (NodeID id, NodeID ptd) |
| virtual bool | addPts (NodeID id, NodeID ptd) |
| virtual void | clearAllPts () |
| Clear all data. | |
| virtual void | expandFIObjs (const PointsTo &pts, PointsTo &expandedPts) |
| Expand FI objects. | |
| virtual void | expandFIObjs (const NodeBS &pts, NodeBS &expandedPts) |
| TODO: remove repetition. | |
| void | remapPointsToSets (void) |
| Remap all points-to sets to use the current mapping. | |
| virtual void | writeToFile (const std::string &filename) |
| Interface for analysis result storage on filesystem. | |
| virtual void | writeObjVarToFile (const std::string &filename) |
| virtual void | writePtsResultToFile (std::fstream &f) |
| virtual void | writeGepObjVarMapToFile (std::fstream &f) |
| virtual bool | readFromFile (const std::string &filename) |
| virtual void | readPtsResultFromFile (std::ifstream &f) |
| virtual void | readGepObjVarMapFromFile (std::ifstream &f) |
| virtual void | readAndSetObjFieldSensitivity (std::ifstream &f, const std::string &delimiterStr) |
| AliasResult | alias (const SVFVar *V1, const SVFVar *V2) override |
| Interface expose to users of our pointer analysis, given Value infos. | |
| AliasResult | alias (NodeID node1, NodeID node2) override |
| Interface expose to users of our pointer analysis, given PAGNodeID. | |
| virtual AliasResult | alias (const PointsTo &pts1, const PointsTo &pts2) |
| Interface expose to users of our pointer analysis, given two pts. | |
| bool | mayAlias (const PointsTo &pts1, const PointsTo &pts2) |
| Convenience bool wrappers: return true if the two operands may/must/partial alias. | |
| void | dumpCPts () override |
| dump and debug, print out conditional pts | |
| void | dumpTopLevelPtsTo () override |
| void | dumpAllPts () override |
| PTDataTy * | getPTDataTy () const |
| Get points-to data structure. | |
| void | finalize () override |
| Finalization of pointer analysis, and normalize points-to information to Bit Vector representation. | |
| virtual bool | updateCallGraph (const CallSiteToFunPtrMap &) |
| Update callgraph. This should be implemented by its subclass. | |
| DiffPTDataTy * | getDiffPTDataTy () const |
| DFPTDataTy * | getDFPTDataTy () const |
| MutDFPTDataTy * | getMutDFPTDataTy () const |
| VersionedPTDataTy * | getVersionedPTDataTy () const |
| virtual void | onTheFlyCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges) |
| On the fly call graph construction. | |
| virtual void | onTheFlyThreadCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newForkEdges) |
| On the fly thread call graph construction respecting forksite. | |
| virtual void | normalizePointsTo () |
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 bit vector based points-to data structure
Definition at line 47 of file PointerAnalysisImpl.h.
Definition at line 53 of file PointerAnalysisImpl.h.
Definition at line 52 of file PointerAnalysisImpl.h.
Definition at line 58 of file PointerAnalysisImpl.h.
Definition at line 57 of file PointerAnalysisImpl.h.
Definition at line 59 of file PointerAnalysisImpl.h.
Definition at line 56 of file PointerAnalysisImpl.h.
| typedef MutableVersionedPTData<NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set<VersionedVar> > SVF::BVDataPTAImpl::MutVersionedPTDataTy |
Definition at line 60 of file PointerAnalysisImpl.h.
Definition at line 64 of file PointerAnalysisImpl.h.
| typedef PersistentDiffPTData<NodeID, NodeSet, NodeID, PointsTo> SVF::BVDataPTAImpl::PersDiffPTDataTy |
Definition at line 63 of file PointerAnalysisImpl.h.
| typedef PersistentIncDFPTData<NodeID, NodeSet, NodeID, PointsTo> SVF::BVDataPTAImpl::PersIncDFPTDataTy |
Definition at line 65 of file PointerAnalysisImpl.h.
Definition at line 62 of file PointerAnalysisImpl.h.
| typedef PersistentVersionedPTData<NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set<VersionedVar> > SVF::BVDataPTAImpl::PersVersionedPTDataTy |
Definition at line 66 of file PointerAnalysisImpl.h.
Definition at line 51 of file PointerAnalysisImpl.h.
| typedef VersionedPTData<NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set<VersionedVar> > SVF::BVDataPTAImpl::VersionedPTDataTy |
Definition at line 54 of file PointerAnalysisImpl.h.
Constructor.
Constructor
Definition at line 48 of file PointerAnalysisImpl.cpp.
|
overridedefault |
Destructor.
Definition at line 119 of file PointerAnalysisImpl.h.
|
virtual |
Interface expose to users of our pointer analysis, given two pts.
Return alias results based on our points-to/alias analysis
Definition at line 629 of file PointerAnalysisImpl.cpp.
|
inlineoverridevirtual |
Interface expose to users of our pointer analysis, given Value infos.
Implements SVF::PointerAnalysis.
Definition at line 216 of file PointerAnalysisImpl.h.
|
overridevirtual |
Interface expose to users of our pointer analysis, given PAGNodeID.
Return alias results based on our points-to/alias analysis
Implements SVF::PointerAnalysis.
Reimplemented in SVF::CFLAlias.
Definition at line 621 of file PointerAnalysisImpl.cpp.
|
inlinestatic |
Definition at line 79 of file PointerAnalysisImpl.h.
|
inlinevirtual |
Clear points-to set of id.
Definition at line 103 of file PointerAnalysisImpl.h.
Remove element from the points-to set of id.
Definition at line 97 of file PointerAnalysisImpl.h.
|
overridevirtual |
Dump all points-to including top-level (ValVar) and address-taken (ObjVar) variables
Reimplemented from SVF::PointerAnalysis.
Definition at line 479 of file PointerAnalysisImpl.cpp.
|
inlineoverridevirtual |
dump and debug, print out conditional pts
Reimplemented from SVF::PointerAnalysis.
Definition at line 236 of file PointerAnalysisImpl.h.
|
overridevirtual |
Dump points-to of each pag node
Reimplemented from SVF::PointerAnalysis.
Definition at line 446 of file PointerAnalysisImpl.cpp.
TODO: remove repetition.
Definition at line 147 of file PointerAnalysisImpl.cpp.
Expand FI objects.
Expand all fields of an aggregate in all points-to sets
Definition at line 135 of file PointerAnalysisImpl.cpp.
|
overrideprotectedvirtual |
Finalization of pointer analysis, and normalize points-to information to Bit Vector representation.
Reimplemented from SVF::PointerAnalysis.
Reimplemented in SVF::CFLAlias, SVF::CFLBase, SVF::CFLVF, SVF::FlowDDA, SVF::FlowSensitive, SVF::TypeAnalysis, and SVF::VersionedFlowSensitive.
Definition at line 95 of file PointerAnalysisImpl.cpp.
|
inlineprotected |
Definition at line 176 of file PointerAnalysisImpl.h.
|
inlineprotected |
Definition at line 169 of file PointerAnalysisImpl.h.
|
inlineprotected |
Definition at line 183 of file PointerAnalysisImpl.h.
|
inline |
Definition at line 74 of file PointerAnalysisImpl.h.
|
inlineprotected |
Get points-to data structure.
Definition at line 153 of file PointerAnalysisImpl.h.
Get points-to and reverse points-to
Implements SVF::PointerAnalysis.
Reimplemented in SVF::Steensgaard.
Definition at line 86 of file PointerAnalysisImpl.h.
Given an object, get all the nodes having whose pointsto contains the object. Similar to getPts, this also needs to be implemented in child classes.
Implements SVF::PointerAnalysis.
Reimplemented in SVF::CFLAlias.
Definition at line 90 of file PointerAnalysisImpl.h.
|
inlineprotected |
Definition at line 190 of file PointerAnalysisImpl.h.
Convenience bool wrappers: return true if the two operands may/must/partial alias.
Definition at line 229 of file PointerAnalysisImpl.h.
|
protectedvirtual |
Normalize points-to information for field-sensitive analysis, i.e., replace fieldObj with baseObj if it is field-insensitive
Normalize points-to information for field-sensitive analysis
Reimplemented in SVF::AndersenBase.
Definition at line 560 of file PointerAnalysisImpl.cpp.
|
protectedvirtual |
On the fly call graph construction.
On the fly call graph construction callsites is candidate indirect callsites need to be analyzed based on points-to results newEdges is the new indirect call edges discovered
Reimplemented in SVF::CFLAlias.
Definition at line 502 of file PointerAnalysisImpl.cpp.
|
protectedvirtual |
On the fly thread call graph construction respecting forksite.
On the fly call graph construction respecting forksite callsites is candidate indirect callsites need to be analyzed based on points-to results newEdges is the new indirect call edges discovered
Definition at line 525 of file PointerAnalysisImpl.cpp.
|
virtual |
Definition at line 387 of file PointerAnalysisImpl.cpp.
Load pointer analysis result form a file. It populates BVDataPTAImpl with the points-to data, and updates SVFIR with the SVFIR offset nodes created during Andersen's solving stage.
Definition at line 413 of file PointerAnalysisImpl.cpp.
|
virtual |
Definition at line 345 of file PointerAnalysisImpl.cpp.
|
virtual |
Definition at line 291 of file PointerAnalysisImpl.cpp.
| void BVDataPTAImpl::remapPointsToSets | ( | void | ) |
Remap all points-to sets to use the current mapping.
Definition at line 159 of file PointerAnalysisImpl.cpp.
Union/add points-to. Add the reverse points-to for node collapse purpose To be noted that adding reverse pts might incur 10% total overhead during solving
Reimplemented in SVF::Andersen, and SVF::Steensgaard.
Definition at line 111 of file PointerAnalysisImpl.h.
Reimplemented in SVF::Andersen, and SVF::Steensgaard.
Definition at line 115 of file PointerAnalysisImpl.h.
|
inlineprotectedvirtual |
Update callgraph. This should be implemented by its subclass.
Reimplemented in SVF::AndersenBase, SVF::CFLAlias, SVF::AndersenSCD, and SVF::FlowSensitive.
Definition at line 163 of file PointerAnalysisImpl.h.
|
virtual |
Definition at line 226 of file PointerAnalysisImpl.cpp.
|
virtual |
Definition at line 164 of file PointerAnalysisImpl.cpp.
|
virtual |
Definition at line 200 of file PointerAnalysisImpl.cpp.
|
virtual |
Interface for analysis result storage on filesystem.
Store pointer analysis result into a file. It includes the points-to relations, and all SVFIR nodes including those created when solving Andersen's constraints.
Definition at line 248 of file PointerAnalysisImpl.cpp.
|
private |
Definition at line 212 of file PointerAnalysisImpl.h.
|
private |
Points-to data.
Definition at line 210 of file PointerAnalysisImpl.h.