Static Value-Flow Analysis
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SVF::FSMPTA Class Reference

#include <FSMPTA.h>

Inheritance diagram for SVF::FSMPTA:
SVF::FlowSensitive SVF::WPAFSSolver< GraphType > SVF::BVDataPTAImpl SVF::WPASolver< GraphType > SVF::PointerAnalysis

Public Member Functions

 FSMPTA (MHP *m, LockAnalysis *la)
 Constructor. More...
 
 ~FSMPTA ()
 Destructor. More...
 
void initialize (SVFModule *module)
 Initialize analysis. More...
 
SVFIRgetPAG ()
 
MHPgetMHP () const
 Get MHP. More...
 
- Public Member Functions inherited from SVF::FlowSensitive
 FlowSensitive (SVFIR *_pag, PTATY type=FSSPARSE_WPA)
 Constructor. More...
 
 ~FlowSensitive () override=default
 Destructor. More...
 
virtual bool runOnModule (SVFModule *)
 We start from here. More...
 
void analyze () override
 Flow sensitive analysis. More...
 
virtual void solveAndwritePtsToFile (const std::string &filename)
 
virtual void readPtsFromFile (const std::string &filename)
 
virtual void solveConstraints ()
 
void finalize () override
 Finalize analysis. More...
 
const std::string PTAName () const override
 Get PTA name. More...
 
SVFGgetSVFG () const
 Return SVFG. More...
 
- Public Member Functions inherited from SVF::WPAFSSolver< GraphType >
 WPAFSSolver ()
 Constructor. More...
 
virtual ~WPAFSSolver ()
 Destructor. More...
 
virtual NodeID sccRepNode (NodeID id) const
 SCC methods. More...
 
- Public Member Functions inherited from SVF::BVDataPTAImpl
 BVDataPTAImpl (SVFIR *pag, PointerAnalysis::PTATY type, bool alias_check=true)
 Constructor. More...
 
 ~BVDataPTAImpl () override=default
 Destructor. More...
 
PersistentPointsToCache< PointsTo > & getPtCache ()
 
const PointsTogetPts (NodeID id) override
 
const NodeSetgetRevPts (NodeID nodeId) override
 
virtual void clearPts (NodeID id, NodeID element)
 Remove element from the points-to set of id. More...
 
virtual void clearFullPts (NodeID id)
 Clear points-to set of id. More...
 
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. More...
 
virtual void expandFIObjs (const PointsTo &pts, PointsTo &expandedPts)
 Expand FI objects. More...
 
virtual void expandFIObjs (const NodeBS &pts, NodeBS &expandedPts)
 TODO: remove repetition. More...
 
void remapPointsToSets (void)
 Remap all points-to sets to use the current mapping. More...
 
virtual void writeToFile (const std::string &filename)
 Interface for analysis result storage on filesystem. More...
 
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 SVFValue *V1, const SVFValue *V2) override
 Interface expose to users of our pointer analysis, given Value infos. More...
 
AliasResult alias (NodeID node1, NodeID node2) override
 Interface expose to users of our pointer analysis, given PAGNodeID. More...
 
virtual AliasResult alias (const PointsTo &pts1, const PointsTo &pts2)
 Interface expose to users of our pointer analysis, given two pts. More...
 
void dumpCPts () override
 dump and debug, print out conditional pts More...
 
void dumpTopLevelPtsTo () override
 
void dumpAllPts () override
 
- Public Member Functions inherited from SVF::PointerAnalysis
ICFGgetICFG () const
 Get ICFG. More...
 
u32_t getNumOfResolvedIndCallEdge () const
 Return number of resolved indirect call edges. More...
 
PTACallGraphgetPTACallGraph () const
 Return call graph. More...
 
CallGraphSCCgetCallGraphSCC () 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...
 
CallEdgeMapgetIndCallMap ()
 Get callees from an indirect callsite. More...
 
bool hasIndCSCallees (const CallICFGNode *cs) const
 
const FunctionSetgetIndCSCallees (const CallICFGNode *cs) const
 
virtual void resolveIndCalls (const CallICFGNode *cs, const PointsTo &target, CallEdgeMap &newEdges)
 Resolve indirect call edges. More...
 
void callGraphSCCDetection ()
 CallGraph 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 CallGraph 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...
 
CommonCHGraphgetCHGraph () 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...
 
SVFIRgetPAG () const
 
PTAStatgetStat () const
 Get PTA stat. More...
 
SVFModulegetModule () const
 Module. More...
 
OrderedNodeSetgetAllValidPtrs ()
 Get all Valid Pointers for resolution. More...
 
virtual ~PointerAnalysis ()
 Destructor. More...
 
virtual void computeDDAPts (NodeID)
 Compute points-to results on-demand, overridden by derived classes. More...
 
void printIndCSTargets (const CallICFGNode *cs, const FunctionSet &targets)
 Print targets of a function pointer. More...
 
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 NodeBSgetAllFieldsObjVars (NodeID id)
 
void setObjFieldInsensitive (NodeID id)
 
bool isFieldInsensitive (NodeID id) const
 

Static Public Member Functions

static FSMPTAcreateFSMPTA (SVFModule *module, MHP *m, LockAnalysis *la)
 Create single instance of flow-sensitive pointer analysis. More...
 
static void releaseFSMPTA ()
 Release flow-sensitive pointer analysis. More...
 
- Static Public Member Functions inherited from SVF::FlowSensitive
static FlowSensitivecreateFSWPA (SVFIR *_pag)
 Create single instance of flow-sensitive pointer analysis. More...
 
static void releaseFSWPA ()
 Release flow-sensitive pointer analysis. More...
 
static bool classof (const FlowSensitive *)
 Methods for support type inquiry through isa, cast, and dyn_cast. More...
 
static bool classof (const PointerAnalysis *pta)
 
- Static Public Member Functions inherited from SVF::BVDataPTAImpl
static bool classof (const PointerAnalysis *pta)
 

Private Member Functions

void initialize () override
 Initialize analysis. More...
 

Private Attributes

MHPmhp
 
LockAnalysislockana
 

Static Private Attributes

static FSMPTAmfspta = nullptr
 

Additional Inherited Members

- Public Types inherited from SVF::FlowSensitive
typedef BVDataPTAImpl::MutDFPTDataTy MutDFPTDataTy
 
typedef BVDataPTAImpl::MutDFPTDataTy::DFPtsMap DFInOutMap
 
typedef BVDataPTAImpl::MutDFPTDataTy::PtsMap PtsMap
 
- Public Types inherited from SVF::WPASolver< GraphType >
typedef SVF::GenericGraphTraits< GraphType > GTraits
 Define the GTraits and node iterator for printing. More...
 
typedef GTraits::NodeRef GNODE
 
typedef GTraits::EdgeType GEDGE
 
typedef GTraits::ChildIteratorType child_iterator
 
typedef SCCDetection< GraphType > SCC
 
typedef FIFOWorkList< NodeIDWorkList
 
- Public Types inherited from SVF::BVDataPTAImpl
enum  PTBackingType { Mutable , Persistent }
 How the PTData used is implemented. More...
 
typedef PTData< NodeID, NodeSet, NodeID, PointsToPTDataTy
 
typedef DiffPTData< NodeID, NodeSet, NodeID, PointsToDiffPTDataTy
 
typedef DFPTData< NodeID, NodeSet, NodeID, PointsToDFPTDataTy
 
typedef VersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > VersionedPTDataTy
 
typedef MutablePTData< NodeID, NodeSet, NodeID, PointsToMutPTDataTy
 
typedef MutableDiffPTData< NodeID, NodeSet, NodeID, PointsToMutDiffPTDataTy
 
typedef MutableDFPTData< NodeID, NodeSet, NodeID, PointsToMutDFPTDataTy
 
typedef MutableIncDFPTData< NodeID, NodeSet, NodeID, PointsToMutIncDFPTDataTy
 
typedef MutableVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > MutVersionedPTDataTy
 
typedef PersistentPTData< NodeID, NodeSet, NodeID, PointsToPersPTDataTy
 
typedef PersistentDiffPTData< NodeID, NodeSet, NodeID, PointsToPersDiffPTDataTy
 
typedef PersistentDFPTData< NodeID, NodeSet, NodeID, PointsToPersDFPTDataTy
 
typedef PersistentIncDFPTData< NodeID, NodeSet, NodeID, PointsToPersIncDFPTDataTy
 
typedef PersistentVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > PersVersionedPTDataTy
 
- 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 *, FunctionSetCallEdgeMap
 
typedef SCCDetection< PTACallGraph * > CallGraphSCC
 
typedef Set< const SVFGlobalValue * > VTableSet
 
typedef Set< const SVFFunction * > VFunSet
 
- Public Attributes inherited from SVF::WPASolver< GraphType >
u32_t numOfIteration
 num of iterations during constraint solving More...
 
- 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 Types inherited from SVF::FlowSensitive
typedef SVFG::SVFGEdgeSetTy SVFGEdgeSetTy
 
- Protected Member Functions inherited from SVF::FlowSensitive
NodeStackSCCDetect () override
 SCC detection. More...
 
bool propFromSrcToDst (SVFGEdge *edge) override
 Propagation. More...
 
virtual bool propAlongDirectEdge (const DirectSVFGEdge *edge)
 Propagate points-to information along a DIRECT SVFG edge. More...
 
virtual bool propAlongIndirectEdge (const IndirectSVFGEdge *edge)
 Propagate points-to information along an INDIRECT SVFG edge. More...
 
virtual bool propVarPtsFromSrcToDst (NodeID var, const SVFGNode *src, const SVFGNode *dst)
 Propagate points-to information of a certain variable from src to dst. More...
 
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. More...
 
virtual bool strongUpdateOutFromIn (const SVFGNode *node, NodeID singleton)
 Handle strong updates. More...
 
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. More...
 
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)
 
void processNode (NodeID nodeId) override
 Handle various constraints. More...
 
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)
 
virtual bool processLoad (const LoadSVFGNode *load)
 
virtual bool processStore (const StoreSVFGNode *store)
 
bool updateCallGraph (const CallSiteToFunPtrMap &callsites) override
 Update call graph. More...
 
void connectCallerAndCallee (const CallEdgeMap &newEdges, SVFGEdgeSetTy &edges)
 Connect nodes in SVFG. More...
 
virtual void updateConnectedNodes (const SVFGEdgeSetTy &edges)
 Update nodes connected during updating call graph. More...
 
bool isStrongUpdate (const SVFGNode *node, NodeID &singleton)
 Return TRUE if this is a strong update STORE statement. More...
 
virtual void countAliases (Set< std::pair< NodeID, NodeID >> cmp, unsigned *mayAliases, unsigned *noAliases)
 Fills may/noAliases for the location/pointer pairs in cmp. More...
 
const PointsTogetDFInPtsSet (const SVFGNode *stmt, const NodeID node)
 Get points-to set for a node from data flow IN/OUT set at a statement. More...
 
const PointsTogetDFOutPtsSet (const SVFGNode *stmt, const NodeID node)
 
virtual void cluster (void)
 
virtual void plainMap (void) const
 Sets the global best mapping as a plain mapping, i.e. n -> n. More...
 
void svfgStat ()
 
const DFInOutMapgetDFInputMap () const
 
const DFInOutMapgetDFOutputMap () const
 
- Protected Member Functions inherited from SVF::WPASolver< GraphType >
 WPASolver ()
 Constructor. More...
 
virtual ~WPASolver ()=default
 Destructor. More...
 
SCCgetSCCDetector () const
 Get SCC detector. More...
 
const GraphType graph ()
 Get/Set graph methods. More...
 
void setGraph (GraphType g)
 
virtual NodeStackSCCDetect (NodeSet &candidates)
 
virtual void initWorklist ()
 
virtual void solveWorklist ()
 
virtual void collapseFields ()
 collapse positive weight cycles of a graph More...
 
virtual void propagate (GNODE *v)
 
virtual bool propFromSrcToDst (GEDGE *)
 Propagate information from source to destination node, to be implemented in the child class. More...
 
NodeID popFromWorklist ()
 Worklist operations. More...
 
virtual void pushIntoWorklist (NodeID id)
 
bool isWorklistEmpty ()
 
bool isInWorklist (NodeID id)
 
GNODENode (NodeID id)
 Get node on the graph. More...
 
NodeID Node_Index (GNODE node)
 Get node ID. More...
 
- Protected Member Functions inherited from SVF::BVDataPTAImpl
PTDataTygetPTDataTy () const
 Get points-to data structure. More...
 
DiffPTDataTygetDiffPTDataTy () const
 
DFPTDataTygetDFPTDataTy () const
 
MutDFPTDataTygetMutDFPTDataTy () const
 
VersionedPTDataTygetVersionedPTDataTy () const
 
virtual void onTheFlyCallGraphSolve (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges)
 On the fly call graph construction. More...
 
virtual void normalizePointsTo ()
 
- Protected Member Functions inherited from SVF::PointerAnalysis
const CallSiteToFunPtrMapgetIndirectCallsites () 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 Attributes inherited from SVF::FlowSensitive
SVFGsvfg
 
SVFGBuilder memSSA
 
AndersenWaveDiffander
 
std::vector< std::pair< hclust_fast_methods, std::vector< NodeID > > > candidateMappings
 Save candidate mappings for evaluation's sake. More...
 
u32_t numOfProcessedAddr
 Statistics. More...
 
u32_t numOfProcessedCopy
 Number of processed Addr node. More...
 
u32_t numOfProcessedGep
 Number of processed Copy node. More...
 
u32_t numOfProcessedPhi
 Number of processed Gep node. More...
 
u32_t numOfProcessedLoad
 Number of processed Phi node. More...
 
u32_t numOfProcessedStore
 Number of processed Load node. More...
 
u32_t numOfProcessedActualParam
 Number of processed Store node. More...
 
u32_t numOfProcessedFormalRet
 Number of processed actual param node. More...
 
u32_t numOfProcessedMSSANode
 Number of processed formal ret node. More...
 
u32_t maxSCCSize
 Number of processed mssa node. More...
 
u32_t numOfSCC
 
u32_t numOfNodesInSCC
 
double solveTime
 time of solve. More...
 
double sccTime
 time of SCC detection. More...
 
double processTime
 time of processNode. More...
 
double propagationTime
 time of points-to propagation. More...
 
double directPropaTime
 time of points-to propagation of address-taken objects More...
 
double indirectPropaTime
 time of points-to propagation of top-level pointers More...
 
double updateTime
 time of strong/weak updates. More...
 
double addrTime
 time of handling address edges More...
 
double copyTime
 time of handling copy edges More...
 
double gepTime
 time of handling gep edges More...
 
double loadTime
 time of load edges More...
 
double storeTime
 time of store edges More...
 
double phiTime
 time of phi nodes. More...
 
double updateCallGraphTime
 time of updating call graph More...
 
NodeBS svfgHasSU
 
- Protected Attributes inherited from SVF::WPAFSSolver< GraphType >
NodeStack nodeStack
 stack used for processing nodes. More...
 
- Protected Attributes inherited from SVF::WPASolver< GraphType >
bool reanalyze
 Reanalyze if any constraint value changed. More...
 
u32_t iterationForPrintStat
 print out statistics for i-th iteration More...
 
GraphType _graph
 Graph. More...
 
std::unique_ptr< SCCscc
 SCC. More...
 
WorkList worklist
 Worklist for resolution. 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...
 
SVFModulesvfMod
 Module. More...
 
PTATY ptaTy
 Pointer analysis Type. More...
 
PTAImplTy ptaImplTy
 PTA implementation type. More...
 
PTAStatstat
 Statistics. More...
 
PTACallGraphptaCallGraph
 Call graph used for pointer analysis. More...
 
CallGraphSCCcallGraphSCC
 SCC for CallGraph. More...
 
ICFGicfg
 Interprocedural control-flow graph. More...
 
CommonCHGraphchgraph
 CHGraph. More...
 
- Static Protected Attributes inherited from SVF::FlowSensitive
static std::unique_ptr< FlowSensitivefspta
 
- Static Protected Attributes inherited from SVF::PointerAnalysis
static SVFIRpag = nullptr
 SVFIR. More...
 

Detailed Description

Flow-sensitive pointer analysis for multithreaded programs

Definition at line 202 of file FSMPTA.h.

Constructor & Destructor Documentation

◆ FSMPTA()

SVF::FSMPTA::FSMPTA ( MHP m,
LockAnalysis la 
)
inline

Constructor.

Definition at line 209 of file FSMPTA.h.

209  : FlowSensitive(m->getTCT()->getPTA()->getPAG()), mhp(m), lockana(la)
210  {
211  }
MHP * mhp
Definition: FSMPTA.h:253
LockAnalysis * lockana
Definition: FSMPTA.h:254
FlowSensitive(SVFIR *_pag, PTATY type=FSSPARSE_WPA)
Constructor.
Definition: FlowSensitive.h:61

◆ ~FSMPTA()

SVF::FSMPTA::~FSMPTA ( )
inline

Destructor.

Definition at line 214 of file FSMPTA.h.

215  {
216  }

Member Function Documentation

◆ createFSMPTA()

static FSMPTA* SVF::FSMPTA::createFSMPTA ( SVFModule module,
MHP m,
LockAnalysis la 
)
inlinestatic

Create single instance of flow-sensitive pointer analysis.

Definition at line 227 of file FSMPTA.h.

228  {
229  if (mfspta == nullptr)
230  {
231  mfspta = new FSMPTA(m,la);
232  mfspta->analyze();
233  }
234  return mfspta;
235  }
FSMPTA(MHP *m, LockAnalysis *la)
Constructor.
Definition: FSMPTA.h:209
static FSMPTA * mfspta
Definition: FSMPTA.h:252
void analyze() override
Flow sensitive analysis.

◆ getMHP()

MHP* SVF::FSMPTA::getMHP ( ) const
inline

Get MHP.

Definition at line 246 of file FSMPTA.h.

247  {
248  return mhp;
249  }

◆ getPAG()

SVFIR* SVF::FSMPTA::getPAG ( )
inline

Definition at line 221 of file FSMPTA.h.

222  {
223  return mhp->getTCT()->getPTA()->getPAG();
224  }
TCT * getTCT() const
Get Thread Creation Tree.
Definition: MHP.h:82
SVFIR * getPAG() const
PointerAnalysis * getPTA() const
Get PTA.
Definition: TCT.h:187

◆ initialize() [1/2]

void FlowSensitive::initialize
overrideprivatevirtual

Initialize analysis.

Initialize analysis

Reimplemented from SVF::FlowSensitive.

Definition at line 111 of file FlowSensitive.cpp.

46 {
48 
49  stat = new FlowSensitiveStat(this);
50 
51  // TODO: support clustered aux. Andersen's.
52  assert(!Options::ClusterAnder() && "FlowSensitive::initialize: clustering auxiliary Andersen's unsupported.");
54 
55  // If cluster option is not set, it will give us a no-mapping points-to set.
57  && "FS::init: plain-mapping and cluster-fs are mutually exclusive.");
58  if (Options::ClusterFs())
59  {
60  cluster();
61  // Reset the points-to cache although empty so the new mapping could
62  // be applied to the inserted empty set.
63  getPtCache().reset();
64  }
65  else if (Options::PlainMappingFs())
66  {
67  plainMap();
68  // As above.
69  getPtCache().reset();
70  }
71 
73 
74  setGraph(svfg);
75  //AndersenWaveDiff::releaseAndersenWaveDiff();
76 }
static AndersenWaveDiff * createAndersenWaveDiff(SVFIR *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
Definition: Andersen.h:395
PersistentPointsToCache< PointsTo > & getPtCache()
SVFIR * getPAG()
Definition: FSMPTA.h:221
virtual void plainMap(void) const
Sets the global best mapping as a plain mapping, i.e. n -> n.
AndersenWaveDiff * ander
SVFGBuilder memSSA
friend class FlowSensitiveStat
Definition: FlowSensitive.h:51
virtual void cluster(void)
static const Option< bool > PlainMappingFs
Use an explicitly plain mapping with flow-sensitive (not null).
Definition: Options.h:47
static const Option< bool > ClusterAnder
Whether to stage Andersen's with Steensgaard and cluster based on that data.
Definition: Options.h:41
static const Option< bool > ClusterFs
Whether to cluster FS or VFS with the auxiliary Andersen's.
Definition: Options.h:44
virtual void initialize()
Initialization of a pointer analysis, including building symbol table and SVFIR etc.
PTAStat * stat
Statistics.
SVFG * buildPTROnlySVFG(BVDataPTAImpl *pta)
Definition: SVFGBuilder.cpp:41
void setGraph(GraphType g)
Definition: WPASolver.h:78

◆ initialize() [2/2]

void FSMPTA::initialize ( SVFModule module)

Initialize analysis.

Initialize analysis

Definition at line 780 of file FSMPTA.cpp.

781 {
783 
785  MTASVFGBuilder mtaSVFGBuilder(mhp,lockana);
786  svfg = mtaSVFGBuilder.buildPTROnlySVFG(ander);
787  setGraph(svfg);
788  //AndersenWaveDiff::releaseAndersenWaveDiff();
789 
790  stat = new FlowSensitiveStat(this);
791 }

◆ releaseFSMPTA()

static void SVF::FSMPTA::releaseFSMPTA ( )
inlinestatic

Release flow-sensitive pointer analysis.

Definition at line 238 of file FSMPTA.h.

239  {
240  if (mfspta)
241  delete mfspta;
242  mfspta = nullptr;
243  }

Member Data Documentation

◆ lockana

LockAnalysis* SVF::FSMPTA::lockana
private

Definition at line 254 of file FSMPTA.h.

◆ mfspta

FSMPTA * FSMPTA::mfspta = nullptr
staticprivate

Definition at line 252 of file FSMPTA.h.

◆ mhp

MHP* SVF::FSMPTA::mhp
private

Definition at line 253 of file FSMPTA.h.


The documentation for this class was generated from the following files: