|
Static Value-Flow Analysis
|
#include <VersionedFlowSensitive.h>
Classes | |
| class | SCC |
Public Member Functions | |
| VersionedFlowSensitive (SVFIR *_pag, PTATY type=PTATY::VFS_WPA) | |
| Constructor. | |
| virtual void | initialize () override |
| Initialize analysis. | |
| virtual void | finalize () override |
| Finalize analysis. | |
| virtual const std::string | PTAName () const override |
| Get PTA name. | |
| virtual bool | isStore (const NodeID l) const |
| Returns true if l is a store node. | |
| virtual bool | isLoad (const NodeID l) const |
| Returns true if l is a load node. | |
| Version | getVersion (const NodeID l, const NodeID o, const LocVersionMap &lvm) const |
| Shared code for getConsume and getYield. They wrap this function. | |
| Version | getConsume (const NodeID l, const NodeID o) const |
| Returns the consumed version of o at l. If no such version exists, returns invalidVersion. | |
| Version | getYield (const NodeID l, const NodeID o) const |
| Returns the yielded version of o at l. If no such version exists, returns invalidVersion. | |
| std::vector< Version > & | getReliantVersions (const NodeID o, const Version v) |
| Returns the versions of o which rely on o:v. | |
| NodeBS & | getStmtReliance (const NodeID o, const Version v) |
| Returns the statements which rely on o:v. | |
| void | dumpReliances (void) const |
| Dumps versionReliance and stmtReliance. | |
| void | dumpLocVersionMaps (void) const |
| Dumps maps consume and yield. | |
| void | solveAndwritePtsToFile (const std::string &filename) override |
| void | writeVersionedAnalysisResultToFile (const std::string &filename) |
| void | readVersionedAnalysisResultFromFile (std::ifstream &F) |
| void | readPtsFromFile (const std::string &filename) override |
| Public Member Functions inherited from SVF::FlowSensitive | |
| FlowSensitive (SVFIR *_pag, PTATY type=PTATY::FSSPARSE_WPA) | |
| Constructor. | |
| ~FlowSensitive () override=default | |
| Destructor. | |
| virtual bool | runOnModule () |
| We start from here. | |
| void | analyze () override |
| Flow sensitive analysis. | |
| virtual void | solveConstraints () |
| SVFG * | getSVFG () const |
| Return SVFG. | |
| Public Member Functions inherited from SVF::WPAFSSolver< SVFG * > | |
| WPAFSSolver () | |
| Constructor. | |
| virtual | ~WPAFSSolver () |
| Destructor. | |
| virtual NodeID | sccRepNode (NodeID id) const |
| SCC methods. | |
| Public Member Functions inherited from SVF::BVDataPTAImpl | |
| BVDataPTAImpl (SVFIR *pag, PTATY type, bool alias_check=true) | |
| Constructor. | |
| ~BVDataPTAImpl () override=default | |
| Destructor. | |
| PersistentPointsToCache< PointsTo > & | getPtCache () |
| 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 |
| bool | mayAlias (const SVFVar *V1, const SVFVar *V2) |
| bool | mayAlias (NodeID node1, NodeID node2) |
| 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. | |
| 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 | 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 | 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 VersionedVar | atKey (NodeID, Version) |
| Return key into vPtD for address-taken var of a specific version. | |
| static bool | classof (const VersionedFlowSensitive *) |
| Methods to support type inquiry through isa, cast, and dyn_cast. | |
| static bool | classof (const PointerAnalysis *pta) |
| static VersionedFlowSensitive * | createVFSWPA (SVFIR *_pag) |
| Create single instance of versioned flow-sensitive points-to analysis. | |
| static void | releaseVFSWPA () |
| Release flow-sensitive pointer analysis. | |
| static void | dumpMeldVersion (MeldVersion &v) |
| Dumps a MeldVersion to stdout. | |
| Static Public Member Functions inherited from SVF::FlowSensitive | |
| static FlowSensitive * | createFSWPA (SVFIR *_pag) |
| Create single instance of flow-sensitive pointer analysis. | |
| static void | releaseFSWPA () |
| Release flow-sensitive pointer analysis. | |
| static bool | classof (const FlowSensitive *) |
| Methods for support type inquiry through isa, cast, and dyn_cast. | |
| static bool | classof (const PointerAnalysis *pta) |
| Static Public Member Functions inherited from SVF::BVDataPTAImpl | |
| static bool | classof (const PointerAnalysis *pta) |
Static Public Attributes | |
| static const Version | invalidVersion = 0 |
| If this version appears, there has been an error. | |
| 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 | |
| virtual bool | processLoad (const LoadSVFGNode *load) override |
| virtual bool | processStore (const StoreSVFGNode *store) override |
| virtual void | processNode (NodeID n) override |
| Handle various constraints. | |
| virtual void | updateConnectedNodes (const SVFGEdgeSetTy &newEdges) override |
| Update nodes connected during updating call graph. | |
| virtual bool | propAlongIndirectEdge (const IndirectSVFGEdge *) override |
| Override to do nothing. Instead, we will use propagateVersion when necessary. | |
| virtual void | cluster (void) override |
| Override since we want to assign different weights based on versioning. | |
| Protected Member Functions inherited from SVF::FlowSensitive | |
| NodeStack & | SCCDetect () override |
| SCC detection. | |
| bool | propFromSrcToDst (SVFGEdge *edge) override |
| Propagation. | |
| virtual bool | propAlongDirectEdge (const DirectSVFGEdge *edge) |
| Propagate points-to information along a DIRECT SVFG edge. | |
| virtual bool | propVarPtsFromSrcToDst (NodeID var, const SVFGNode *src, const SVFGNode *dst) |
| Propagate points-to information of a certain variable from src to dst. | |
| virtual bool | propagateFromAPToFP (const ActualParmSVFGNode *ap, const SVFGNode *dst) |
| virtual bool | propagateFromFRToAR (const FormalRetSVFGNode *fr, const SVFGNode *dst) |
| virtual bool | weakUpdateOutFromIn (const SVFGNode *node) |
| Handle weak updates. | |
| virtual bool | strongUpdateOutFromIn (const SVFGNode *node, NodeID singleton) |
| Handle strong updates. | |
| bool | propVarPtsAfterCGUpdated (NodeID var, const SVFGNode *src, const SVFGNode *dst) |
| virtual bool | propDFOutToIn (const SVFGNode *srcStmt, NodeID srcVar, const SVFGNode *dstStmt, NodeID dstVar) |
| virtual bool | propDFInToIn (const SVFGNode *srcStmt, NodeID srcVar, const SVFGNode *dstStmt, NodeID dstVar) |
| bool | updateOutFromIn (const SVFGNode *srcStmt, NodeID srcVar, const SVFGNode *dstStmt, NodeID dstVar) |
| Update data-flow points-to data. | |
| virtual bool | updateInFromIn (const SVFGNode *srcStmt, NodeID srcVar, const SVFGNode *dstStmt, NodeID dstVar) |
| virtual bool | updateInFromOut (const SVFGNode *srcStmt, NodeID srcVar, const SVFGNode *dstStmt, NodeID dstVar) |
| virtual bool | unionPtsFromIn (const SVFGNode *stmt, NodeID srcVar, NodeID dstVar) |
| virtual bool | unionPtsFromTop (const SVFGNode *stmt, NodeID srcVar, NodeID dstVar) |
| void | clearAllDFOutVarFlag (const SVFGNode *stmt) |
| bool | processSVFGNode (SVFGNode *node) |
| virtual bool | processAddr (const AddrSVFGNode *addr) |
| virtual bool | processCopy (const CopySVFGNode *copy) |
| virtual bool | processPhi (const PHISVFGNode *phi) |
| virtual bool | processGep (const GepSVFGNode *edge) |
| bool | updateCallGraph (const CallSiteToFunPtrMap &callsites) override |
| Update call graph. | |
| void | connectCallerAndCallee (const CallEdgeMap &newEdges, SVFGEdgeSetTy &edges) |
| Connect nodes in SVFG. | |
| bool | isStrongUpdate (const SVFGNode *node, NodeID &singleton) |
| Return TRUE if this is a strong update STORE statement. | |
| virtual void | countAliases (Set< std::pair< NodeID, NodeID > > cmp, unsigned *mayAliases, unsigned *noAliases) |
| Fills may/noAliases for the location/pointer pairs in cmp. | |
| const PointsTo & | getDFInPtsSet (const SVFGNode *stmt, const NodeID node) |
| Get points-to set for a node from data flow IN/OUT set at a statement. | |
| const PointsTo & | getDFOutPtsSet (const SVFGNode *stmt, const NodeID node) |
| virtual void | plainMap (void) const |
| Sets the global best mapping as a plain mapping, i.e. n -> n. | |
| void | svfgStat () |
| const DFInOutMap & | getDFInputMap () const |
| const DFInOutMap & | getDFOutputMap () const |
| Protected Member Functions inherited from SVF::WPASolver< GraphType > | |
| WPASolver () | |
| Constructor. | |
| virtual | ~WPASolver ()=default |
| Destructor. | |
| SCC * | getSCCDetector () const |
| Get SCC detector. | |
| const GraphType | graph () |
| Get/Set graph methods. | |
| void | setGraph (GraphType g) |
| virtual NodeStack & | SCCDetect (NodeSet &candidates) |
| virtual void | initWorklist () |
| virtual void | solveWorklist () |
| virtual void | collapseFields () |
| collapse positive weight cycles of a graph | |
| virtual void | propagate (GNODE *v) |
| virtual bool | propFromSrcToDst (GEDGE *) |
| Propagate information from source to destination node, to be implemented in the child class. | |
| NodeID | popFromWorklist () |
| Worklist operations. | |
| virtual void | pushIntoWorklist (NodeID id) |
| bool | isWorklistEmpty () |
| bool | isInWorklist (NodeID id) |
| GNODE * | Node (NodeID id) |
| Get node on the graph. | |
| NodeID | Node_Index (GNODE node) |
| Get node ID. | |
| PTDataTy * | getPTDataTy () const |
| Get points-to data structure. | |
| 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 () |
| 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. | |
Private Types | |
| typedef CoreBitVector | MeldVersion |
Private Member Functions | |
| void | prelabel (void) |
| Prelabel the SVFG: set y(o) for stores and c(o) for delta nodes to a new version. | |
| void | meldLabel (void) |
| Meld label the prelabeled SVFG. | |
| void | removeAllIndirectSVFGEdges (void) |
| Removes all indirect edges in the SVFG. | |
| void | propagateVersion (NodeID o, Version v) |
| void | propagateVersion (const NodeID o, const Version v, const Version vp, bool time=true) |
| virtual void | buildIsStoreLoadMaps (void) |
| Fills in isStoreMap and isLoadMap. | |
| virtual void | buildDeltaMaps (void) |
| Fills in deltaMap and deltaSourceMap for the SVFG. | |
| virtual bool | delta (const NodeID l) const |
| virtual bool | deltaSource (const NodeID l) const |
| void | setVersion (const NodeID l, const NodeID o, const Version v, LocVersionMap &lvm) |
| Shared code for setConsume and setYield. They wrap this function. | |
| void | setConsume (const NodeID l, const NodeID o, const Version v) |
| Sets the consumed version of o at l to v. | |
| void | setYield (const NodeID l, const NodeID o, const Version v) |
| Sets the yielded version of o at l to v. | |
Static Private Member Functions | |
| static bool | meld (MeldVersion &mv1, const MeldVersion &mv2) |
| Melds v2 into v1 (in place), returns whether a change occurred. | |
Private Attributes | |
| LocVersionMap | consume |
| LocVersionMap | yield |
| Actual yield map. Yield analogue to consume. | |
| VersionRelianceMap | versionReliance |
| o -> (version -> versions which rely on it). | |
| Map< NodeID, Map< Version, NodeBS > > | stmtReliance |
| o x version -> statement nodes which rely on that o/version. | |
| VarToPropNodeMap | versionedVarToPropNode |
| Map< NodeID, NodeID > | equivalentObject |
| FIFOWorkList< NodeID > | vWorklist |
| Set< NodeID > | prelabeledObjects |
| BVDataPTAImpl::VersionedPTDataTy * | vPtD |
| Points-to DS for working with versions. | |
| std::vector< bool > | deltaMap |
| std::vector< bool > | deltaSourceMap |
| std::vector< bool > | isStoreMap |
| isStoreMap[l] means SVFG node l is a store node. | |
| std::vector< bool > | isLoadMap |
| isLoadMap[l] means SVFG node l is a load node. | |
| u32_t | numPrelabeledNodes |
| Additional statistics. | |
| u32_t | numPrelabelVersions |
| Number of versions created during prelabeling. | |
| double | prelabelingTime |
| Time to prelabel SVFG. | |
| double | meldLabelingTime |
| Time to meld label SVFG. | |
| double | versionPropTime |
| Time to propagate versions to versions which rely on them. | |
Static Private Attributes | |
| static VersionedFlowSensitive * | vfspta = nullptr |
Friends | |
| class | VersionedFlowSensitiveStat |
Additional Inherited Members | |
| Public Attributes inherited from SVF::WPASolver< GraphType > | |
| u32_t | numOfIteration |
| num of iterations during constraint solving | |
| Protected Types inherited from SVF::FlowSensitive | |
| typedef SVFG::SVFGEdgeSetTy | SVFGEdgeSetTy |
| Protected Attributes inherited from SVF::FlowSensitive | |
| SVFG * | svfg |
| SVFGBuilder | memSSA |
| AndersenWaveDiff * | ander |
| std::vector< std::pair< hclust_fast_methods, std::vector< NodeID > > > | candidateMappings |
| Save candidate mappings for evaluation's sake. | |
| u32_t | numOfProcessedAddr |
| Statistics. | |
| u32_t | numOfProcessedCopy |
| Number of processed Addr node. | |
| u32_t | numOfProcessedGep |
| Number of processed Copy node. | |
| u32_t | numOfProcessedPhi |
| Number of processed Gep node. | |
| u32_t | numOfProcessedLoad |
| Number of processed Phi node. | |
| u32_t | numOfProcessedStore |
| Number of processed Load node. | |
| u32_t | numOfProcessedActualParam |
| Number of processed Store node. | |
| u32_t | numOfProcessedFormalRet |
| Number of processed actual param node. | |
| u32_t | numOfProcessedMSSANode |
| Number of processed formal ret node. | |
| u32_t | maxSCCSize |
| Number of processed mssa node. | |
| u32_t | numOfSCC |
| u32_t | numOfNodesInSCC |
| double | solveTime |
| time of solve. | |
| double | sccTime |
| time of SCC detection. | |
| double | processTime |
| time of processNode. | |
| double | propagationTime |
| time of points-to propagation. | |
| double | directPropaTime |
| time of points-to propagation of address-taken objects | |
| double | indirectPropaTime |
| time of points-to propagation of top-level pointers | |
| double | updateTime |
| time of strong/weak updates. | |
| double | addrTime |
| time of handling address edges | |
| double | copyTime |
| time of handling copy edges | |
| double | gepTime |
| time of handling gep edges | |
| double | loadTime |
| time of load edges | |
| double | storeTime |
| time of store edges | |
| double | phiTime |
| time of phi nodes. | |
| double | updateCallGraphTime |
| time of updating call graph | |
| NodeBS | svfgHasSU |
| Protected Attributes inherited from SVF::WPAFSSolver< SVFG * > | |
| NodeStack | nodeStack |
| stack used for processing nodes. | |
| Protected Attributes inherited from SVF::WPASolver< GraphType > | |
| bool | reanalyze |
| Reanalyze if any constraint value changed. | |
| u32_t | iterationForPrintStat |
| print out statistics for i-th iteration | |
| GraphType | _graph |
| Graph. | |
| std::unique_ptr< SCC > | scc |
| SCC. | |
| WorkList | worklist |
| Worklist for resolution. | |
| 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::FlowSensitive | |
| static std::unique_ptr< FlowSensitive > | fspta |
| Static Protected Attributes inherited from SVF::PointerAnalysis | |
| static SVFIR * | pag = nullptr |
| SVFIR. | |
Versioned flow sensitive whole program pointer analysis
Definition at line 29 of file VersionedFlowSensitive.h.
| typedef std::vector<ObjToVersionMap> SVF::VersionedFlowSensitive::LocVersionMap |
Definition at line 40 of file VersionedFlowSensitive.h.
|
private |
Definition at line 34 of file VersionedFlowSensitive.h.
Definition at line 37 of file VersionedFlowSensitive.h.
| typedef Map<VersionedVar, const DummyVersionPropSVFGNode *> SVF::VersionedFlowSensitive::VarToPropNodeMap |
Definition at line 38 of file VersionedFlowSensitive.h.
| typedef Map<NodeID, Map<Version, std::vector<Version> > > SVF::VersionedFlowSensitive::VersionRelianceMap |
(o -> (v -> versions with rely on o:v).
Definition at line 42 of file VersionedFlowSensitive.h.
| VersionedFlowSensitive::VersionedFlowSensitive | ( | SVFIR * | _pag, |
| PTATY | type = PTATY::VFS_WPA ) |
Constructor.
Definition at line 33 of file VersionedFlowSensitive.cpp.
|
static |
Return key into vPtD for address-taken var of a specific version.
Definition at line 27 of file VersionedFlowSensitive.cpp.
|
privatevirtual |
Fills in deltaMap and deltaSourceMap for the SVFG.
use pre-analysis call graph to approximate all potential callsites
Definition at line 470 of file VersionedFlowSensitive.cpp.
|
privatevirtual |
Fills in isStoreMap and isLoadMap.
Definition at line 447 of file VersionedFlowSensitive.cpp.
|
inlinestatic |
Definition at line 71 of file VersionedFlowSensitive.h.
|
inlinestatic |
Methods to support type inquiry through isa, cast, and dyn_cast.
Definition at line 67 of file VersionedFlowSensitive.h.
|
overrideprotectedvirtual |
Override since we want to assign different weights based on versioning.
Reimplemented from SVF::FlowSensitive.
Definition at line 783 of file VersionedFlowSensitive.cpp.
|
inlinestatic |
Create single instance of versioned flow-sensitive points-to analysis.
Definition at line 78 of file VersionedFlowSensitive.h.
|
privatevirtual |
Returns true if l is a delta node, i.e., may get a new incoming indirect edge due to on-the-fly callgraph construction.
Definition at line 435 of file VersionedFlowSensitive.cpp.
|
privatevirtual |
Returns true if l is a delta-source node, i.e., may get a new outgoing indirect edge to a delta node due to on-the-fly callgraph construction.
Definition at line 441 of file VersionedFlowSensitive.cpp.
| void VersionedFlowSensitive::dumpLocVersionMaps | ( | void | ) | const |
Dumps maps consume and yield.
Definition at line 913 of file VersionedFlowSensitive.cpp.
|
static |
Dumps a MeldVersion to stdout.
Definition at line 949 of file VersionedFlowSensitive.cpp.
| void VersionedFlowSensitive::dumpReliances | ( | void | ) | const |
Dumps versionReliance and stmtReliance.
Definition at line 856 of file VersionedFlowSensitive.cpp.
|
overridevirtual |
Finalize analysis.
Reimplemented from SVF::FlowSensitive.
Definition at line 68 of file VersionedFlowSensitive.cpp.
Returns the consumed version of o at l. If no such version exists, returns invalidVersion.
Definition at line 816 of file VersionedFlowSensitive.cpp.
| std::vector< Version > & VersionedFlowSensitive::getReliantVersions | ( | const NodeID | o, |
| const Version | v ) |
Returns the versions of o which rely on o:v.
Definition at line 846 of file VersionedFlowSensitive.cpp.
Returns the statements which rely on o:v.
Definition at line 851 of file VersionedFlowSensitive.cpp.
| Version VersionedFlowSensitive::getVersion | ( | const NodeID | l, |
| const NodeID | o, | ||
| const LocVersionMap & | lvm ) const |
Shared code for getConsume and getYield. They wrap this function.
Definition at line 806 of file VersionedFlowSensitive.cpp.
Returns the yielded version of o at l. If no such version exists, returns invalidVersion.
Definition at line 821 of file VersionedFlowSensitive.cpp.
|
overridevirtual |
Initialize analysis.
Reimplemented from SVF::FlowSensitive.
Definition at line 48 of file VersionedFlowSensitive.cpp.
|
virtual |
Returns true if l is a load node.
Definition at line 464 of file VersionedFlowSensitive.cpp.
|
virtual |
Returns true if l is a store node.
Definition at line 458 of file VersionedFlowSensitive.cpp.
|
staticprivate |
Melds v2 into v1 (in place), returns whether a change occurred.
Definition at line 429 of file VersionedFlowSensitive.cpp.
|
private |
Meld label the prelabeled SVFG.
Definition at line 123 of file VersionedFlowSensitive.cpp.
|
private |
Prelabel the SVFG: set y(o) for stores and c(o) for delta nodes to a new version.
Definition at line 76 of file VersionedFlowSensitive.cpp.
|
overrideprotectedvirtual |
Process load node
Foreach node \in src pts(dst) = union pts(node)
If o is a field-insensitive object, we should also get all field nodes' points-to sets and pass them to p.
If the ptd is a field-insensitive node, we should also get all field nodes' points-to sets and pass them to pagDst.
Reimplemented from SVF::FlowSensitive.
Definition at line 650 of file VersionedFlowSensitive.cpp.
|
overrideprotectedvirtual |
Handle various constraints.
Process each SVFG node
Reimplemented from SVF::FlowSensitive.
Definition at line 593 of file VersionedFlowSensitive.cpp.
|
overrideprotectedvirtual |
Process store node
foreach node \in dst pts(node) = union pts(src)
STORE statement can only be processed if the pointer on the LHS points to something. If we handle STORE with an empty points-to set, the OUT set will be updated from IN set. Then if LHS pointer points-to one target and it has been identified as a strong update, we can't remove those points-to information computed before this strong update from the OUT set.
check if this is a strong updates store
Reimplemented from SVF::FlowSensitive.
Definition at line 696 of file VersionedFlowSensitive.cpp.
|
private |
Propagates version v of o to version vp of o. time indicates whether it should record time taken itself.
Definition at line 563 of file VersionedFlowSensitive.cpp.
Propagates version v of o to any version of o which relies on v when o/v is changed. Recursively applies to reliant versions till no new changes are made. Adds any statements which rely on any changes made to the worklist.
Definition at line 549 of file VersionedFlowSensitive.cpp.
|
inlineoverrideprotectedvirtual |
Override to do nothing. Instead, we will use propagateVersion when necessary.
Reimplemented from SVF::FlowSensitive.
Definition at line 103 of file VersionedFlowSensitive.h.
|
inlineoverridevirtual |
Get PTA name.
Reimplemented from SVF::FlowSensitive.
Definition at line 60 of file VersionedFlowSensitive.h.
|
overridevirtual |
Initialization for the Solver
Load the pts from file
finalize the analysis
Reimplemented from SVF::FlowSensitive.
Definition at line 967 of file VersionedFlowSensitive.cpp.
| void VersionedFlowSensitive::readVersionedAnalysisResultFromFile | ( | std::ifstream & | F | ) |
Definition at line 1071 of file VersionedFlowSensitive.cpp.
|
inlinestatic |
Release flow-sensitive pointer analysis.
Definition at line 90 of file VersionedFlowSensitive.h.
|
private |
Removes all indirect edges in the SVFG.
Definition at line 527 of file VersionedFlowSensitive.cpp.
Sets the consumed version of o at l to v.
Definition at line 834 of file VersionedFlowSensitive.cpp.
|
private |
Shared code for setConsume and setYield. They wrap this function.
Definition at line 828 of file VersionedFlowSensitive.cpp.
Sets the yielded version of o at l to v.
Definition at line 839 of file VersionedFlowSensitive.cpp.
|
overridevirtual |
Start analysis
Initialization for the Solver
finalize the analysis
Initialization for the Solver
finalize the analysis
Reimplemented from SVF::FlowSensitive.
Definition at line 1003 of file VersionedFlowSensitive.cpp.
|
overrideprotectedvirtual |
Update nodes connected during updating call graph.
Push nodes connected during update call graph into worklist so they will be solved during next iteration.
If this is a formal-param or actual-ret node, we need to solve this phi node in next iteration
If this is a formal-in or actual-out node, we need to propagate points-to information from its predecessor node.
If this is a field-insensitive obj, propagate all field node's pts
Reimplemented from SVF::FlowSensitive.
Definition at line 608 of file VersionedFlowSensitive.cpp.
| void VersionedFlowSensitive::writeVersionedAnalysisResultToFile | ( | const std::string & | filename | ) |
Definition at line 1019 of file VersionedFlowSensitive.cpp.
|
friend |
Definition at line 31 of file VersionedFlowSensitive.h.
|
private |
Maps locations to objects to a version. The object version is what is consumed at that location.
Definition at line 195 of file VersionedFlowSensitive.h.
|
private |
deltaMap[l] means SVFG node l is a delta node, i.e., may get new incoming edges due to OTF callgraph construction.
Definition at line 224 of file VersionedFlowSensitive.h.
|
private |
deltaSourceMap[l] means SVFG node l may be a source to a delta node through an dge added as a result of on-the-fly callgraph construction.
Definition at line 229 of file VersionedFlowSensitive.h.
Definition at line 211 of file VersionedFlowSensitive.h.
|
static |
If this version appears, there has been an error.
Definition at line 45 of file VersionedFlowSensitive.h.
|
private |
isLoadMap[l] means SVFG node l is a load node.
Definition at line 235 of file VersionedFlowSensitive.h.
|
private |
isStoreMap[l] means SVFG node l is a store node.
Definition at line 232 of file VersionedFlowSensitive.h.
|
private |
Time to meld label SVFG.
Definition at line 243 of file VersionedFlowSensitive.h.
|
private |
Additional statistics.
Number of prelabeled nodes.
Definition at line 239 of file VersionedFlowSensitive.h.
|
private |
Number of versions created during prelabeling.
Definition at line 240 of file VersionedFlowSensitive.h.
Definition at line 217 of file VersionedFlowSensitive.h.
|
private |
Time to prelabel SVFG.
Definition at line 242 of file VersionedFlowSensitive.h.
o x version -> statement nodes which rely on that o/version.
Definition at line 202 of file VersionedFlowSensitive.h.
|
private |
Maps an <object, version> pair to the SVFG node indicating that pair needs to be propagated.
Definition at line 206 of file VersionedFlowSensitive.h.
|
private |
Time to propagate versions to versions which rely on them.
Definition at line 244 of file VersionedFlowSensitive.h.
|
private |
o -> (version -> versions which rely on it).
Definition at line 200 of file VersionedFlowSensitive.h.
|
staticprivate |
Definition at line 247 of file VersionedFlowSensitive.h.
|
private |
Points-to DS for working with versions.
Definition at line 220 of file VersionedFlowSensitive.h.
|
private |
Worklist for performing meld labeling, takes SVFG node l. Nodes are added when the version they yield is changed.
Definition at line 215 of file VersionedFlowSensitive.h.
|
private |
Actual yield map. Yield analogue to consume.
Definition at line 197 of file VersionedFlowSensitive.h.