Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::TypeAnalysis Class Reference

#include <TypeAnalysis.h>

Inheritance diagram for SVF::TypeAnalysis:
SVF::AndersenBase SVF::WPASolver< ConstraintGraph * > SVF::BVDataPTAImpl SVF::PointerAnalysis

Public Member Functions

 TypeAnalysis (PAG *pag)
 Constructor.
virtual ~TypeAnalysis ()
 Destructor.
void analyze () override
 Type analysis.
void initialize () override
 Initialize analysis.
virtual void finalize () override
 Finalize analysis.
bool addCopyEdge (NodeID src, NodeID dst) override
 Add copy edge on constraint graph.
void callGraphSolveBasedOnCHA (const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges)
 Resolve callgraph based on CHA.
void dumpCHAStats ()
 Statistics of CHA and callgraph.
Public Member Functions inherited from SVF::AndersenBase
 AndersenBase (PAG *_pag, PTATY type=PTATY::Andersen_BASE, bool alias_check=true)
 Constructor.
 ~AndersenBase () override
 Destructor.
virtual void solveAndwritePtsToFile (const std::string &filename)
virtual void readPtsFromFile (const std::string &filename)
virtual void solveConstraints ()
virtual bool updateCallGraph (const CallSiteToFunPtrMap &) override
 Update call graph.
virtual bool updateThreadCallGraph (const CallSiteToFunPtrMap &, NodePairSet &)
 Update thread call graph.
virtual void connectCaller2ForkedFunParams (const CallICFGNode *cs, const FunObjVar *F, NodePairSet &cpySrcNodes)
 Connect formal and actual parameters for indirect forksites.
virtual void connectCaller2CalleeParams (const CallICFGNode *cs, const FunObjVar *F, NodePairSet &cpySrcNodes)
 Connect formal and actual parameters for indirect callsites.
ConstraintGraph * getConstraintGraph ()
 Get constraint graph.
NodeID sccRepNode (NodeID id) const override
 SCC methods.
NodeBS & sccSubNodes (NodeID repId)
void printStat ()
 dump statistics
virtual void normalizePointsTo () override
void cleanConsCG (NodeID id)
 remove redundant gepnodes in constraint graph
Public Member Functions inherited from SVF::BVDataPTAImpl
 BVDataPTAImpl (PAG *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 (PAG *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.
PAG * 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 bool classof (const TypeAnalysis *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const PointerAnalysis *pta)
Static Public Member Functions inherited from SVF::AndersenBase
static bool classof (const AndersenBase *)
 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)

Additional Inherited Members

Public Types inherited from SVF::AndersenBase
typedef OrderedMap< const CallICFGNode *, NodeID > CallSite2DummyValPN
Public Types inherited from SVF::WPASolver< ConstraintGraph * >
typedef SVF::GenericGraphTraits< ConstraintGraph * > GTraits
 Define the GTraits and node iterator for printing.
typedef GTraits::NodeRef GNODE
typedef GTraits::EdgeType GEDGE
typedef GTraits::ChildIteratorType child_iterator
typedef SCCDetection< ConstraintGraph * > SCC
typedef FIFOWorkList< NodeID > WorkList
Public Types inherited from SVF::BVDataPTAImpl
typedef PTData< NodeID, NodeSet, NodeID, PointsTo > PTDataTy
typedef DiffPTData< NodeID, NodeSet, NodeID, PointsTo > DiffPTDataTy
typedef DFPTData< NodeID, NodeSet, NodeID, PointsTo > DFPTDataTy
typedef VersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > VersionedPTDataTy
typedef MutablePTData< NodeID, NodeSet, NodeID, PointsTo > MutPTDataTy
typedef MutableDiffPTData< NodeID, NodeSet, NodeID, PointsTo > MutDiffPTDataTy
typedef MutableDFPTData< NodeID, NodeSet, NodeID, PointsTo > MutDFPTDataTy
typedef MutableIncDFPTData< NodeID, NodeSet, NodeID, PointsTo > MutIncDFPTDataTy
typedef MutableVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > MutVersionedPTDataTy
typedef PersistentPTData< NodeID, NodeSet, NodeID, PointsTo > PersPTDataTy
typedef PersistentDiffPTData< NodeID, NodeSet, NodeID, PointsTo > PersDiffPTDataTy
typedef PersistentDFPTData< NodeID, NodeSet, NodeID, PointsTo > PersDFPTDataTy
typedef PersistentIncDFPTData< NodeID, NodeSet, NodeID, PointsTo > PersIncDFPTDataTy
typedef PersistentVersionedPTData< NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set< VersionedVar > > PersVersionedPTDataTy
Public Types inherited from SVF::PointerAnalysis
typedef Set< const CallICFGNode * > CallSiteSet
 Indirect call edges type, map a callsite to a set of callees.
typedef PAG::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 Attributes inherited from SVF::AndersenBase
NodeBS redundantGepNodes
Public Attributes inherited from SVF::WPASolver< ConstraintGraph * >
u32_t numOfIteration
 num of iterations during constraint solving
Static Public Attributes inherited from SVF::AndersenBase
static u32_t numOfProcessedAddr = 0
 Statistics.
static u32_t numOfProcessedCopy = 0
 Number of processed Addr edge.
static u32_t numOfProcessedGep = 0
 Number of processed Copy edge.
static u32_t numOfProcessedLoad = 0
 Number of processed Gep edge.
static u32_t numOfProcessedStore = 0
 Number of processed Load edge.
static u32_t numOfSfrs = 0
 Number of processed Store edge.
static u32_t numOfFieldExpand = 0
static u32_t numOfSCCDetection = 0
static double timeOfSCCDetection = 0
static double timeOfSCCMerges = 0
static double timeOfCollapse = 0
static u32_t AveragePointsToSetSize = 0
static u32_t MaxPointsToSetSize = 0
static double timeOfProcessCopyGep = 0
static double timeOfProcessLoadStore = 0
static double timeOfUpdateCallGraph = 0
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::AndersenBase
void heapAllocatorViaIndCall (const CallICFGNode *cs, NodePairSet &cpySrcNodes)
Protected Member Functions inherited from SVF::WPASolver< ConstraintGraph * >
 WPASolver ()
 Constructor.
virtual ~WPASolver ()=default
 Destructor.
SCC * getSCCDetector () const
 Get SCC detector.
const ConstraintGraph * graph ()
 Get/Set graph methods.
void setGraph (ConstraintGraph *g)
virtual NodeStack & SCCDetect ()
 SCC detection.
virtual NodeStack & SCCDetect (NodeSet &candidates)
virtual void initWorklist ()
virtual void solveWorklist ()
virtual void processNode (NodeID)
 Following methods are to be implemented in child class, in order to achieve a fully worked PTA.
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.
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::AndersenBase
ConstraintGraph * consCG
 Constraint Graph.
CallSite2DummyValPN callsite2DummyValPN
Protected Attributes inherited from SVF::WPASolver< ConstraintGraph * >
bool reanalyze
 Reanalyze if any constraint value changed.
u32_t iterationForPrintStat
 print out statistics for i-th iteration
ConstraintGraph * _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::PointerAnalysis
static PAG * pag = nullptr
 PAG.

Detailed Description

Definition at line 43 of file TypeAnalysis.h.

Constructor & Destructor Documentation

◆ TypeAnalysis()

SVF::TypeAnalysis::TypeAnalysis ( PAG * pag)
inline

Constructor.

Definition at line 48 of file TypeAnalysis.h.

50 {
51 }
AndersenBase(PAG *_pag, PTATY type=PTATY::Andersen_BASE, bool alias_check=true)
Constructor.
Definition Andersen.h:68
static PAG * pag
PAG.
@ TypeCPP_WPA
Type-based analysis for C++.
Definition PTATY.h:26

◆ ~TypeAnalysis()

virtual SVF::TypeAnalysis::~TypeAnalysis ( )
inlinevirtual

Destructor.

Definition at line 54 of file TypeAnalysis.h.

55 {
56 }

Member Function Documentation

◆ addCopyEdge()

bool SVF::TypeAnalysis::addCopyEdge ( NodeID src,
NodeID dst )
inlineoverridevirtual

Add copy edge on constraint graph.

Implements SVF::AndersenBase.

Definition at line 68 of file TypeAnalysis.h.

69 {
70 assert(false && "this function should never be executed!");
71 return false;
72 }

◆ analyze()

void TypeAnalysis::analyze ( )
overridevirtual

Type analysis.

Reimplemented from SVF::AndersenBase.

Definition at line 67 of file TypeAnalysis.cpp.

68{
69 initialize();
70 CallEdgeMap newEdges;
72 finalize();
73}
OrderedMap< const CallICFGNode *, FunctionSet > CallEdgeMap
const CallSiteToFunPtrMap & getIndirectCallsites() const
Return all indirect callsites.
virtual void finalize() override
Finalize analysis.
void initialize() override
Initialize analysis.
void callGraphSolveBasedOnCHA(const CallSiteToFunPtrMap &callsites, CallEdgeMap &newEdges)
Resolve callgraph based on CHA.

◆ callGraphSolveBasedOnCHA()

void TypeAnalysis::callGraphSolveBasedOnCHA ( const CallSiteToFunPtrMap & callsites,
CallEdgeMap & newEdges )

Resolve callgraph based on CHA.

Definition at line 75 of file TypeAnalysis.cpp.

76{
77 for(CallSiteToFunPtrMap::const_iterator iter = callsites.begin(), eiter = callsites.end(); iter!=eiter; ++iter)
78 {
79 const CallICFGNode* cbn = iter->first;
80 if (cbn->isVirtualCall())
81 {
82 const SVFVar* vtbl = cbn->getVtablePtr();
83 (void)vtbl; // Suppress warning of unused variable under release build
84 assert(vtbl != nullptr);
85 VFunSet vfns;
86 getVFnsFromCHA(cbn, vfns);
87 connectVCallToVFns(cbn, vfns, newEdges);
88 }
89 }
90}
const SVFVar * getVtablePtr() const
Definition ICFGNode.h:520
bool isVirtualCall() const
Definition ICFGNode.h:510
void connectVCallToVFns(const CallICFGNode *cs, const VFunSet &vfns, CallEdgeMap &newEdges)
void getVFnsFromCHA(const CallICFGNode *cs, VFunSet &vfns)
Set< const FunObjVar * > VFunSet

◆ classof() [1/2]

bool SVF::TypeAnalysis::classof ( const PointerAnalysis * pta)
inlinestatic

Definition at line 86 of file TypeAnalysis.h.

87 {
88 return (pta->getAnalysisTy() == TypeCPP_WPA);
89 }

◆ classof() [2/2]

bool SVF::TypeAnalysis::classof ( const TypeAnalysis * )
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 82 of file TypeAnalysis.h.

83 {
84 return true;
85 }

◆ dumpCHAStats()

void TypeAnalysis::dumpCHAStats ( )

Statistics of CHA and callgraph.

Definition at line 93 of file TypeAnalysis.cpp.

94{
95
97 if (chgraph == nullptr)
98 {
99 SVFUtil::errs() << "dumpCHAStats only implemented for standard CHGraph.\n";
100 return;
101 }
102
103 u32_t pure_abstract_class_num = 0,
104 multi_inheritance_class_num = 0;
105 for (CHGraph::const_iterator it = chgraph->begin(), eit = chgraph->end();
106 it != eit; ++it)
107 {
108 CHNode *node = it->second;
109 outs() << "class " << node->getName() << "\n";
110 if (node->isPureAbstract())
111 pure_abstract_class_num++;
112 if (node->isMultiInheritance())
113 multi_inheritance_class_num++;
114 }
115 outs() << "class_num:\t" << chgraph->getTotalNodeNum() << '\n';
116 outs() << "pure_abstract_class_num:\t" << pure_abstract_class_num << '\n';
117 outs() << "multi_inheritance_class_num:\t" << multi_inheritance_class_num << '\n';
118
119 /*
120 * count the following info:
121 * vtblnum
122 * total vfunction
123 * vtbl max vfunction
124 * pure abstract class
125 */
126 u32_t vtblnum = 0,
127 vfunc_total = 0,
128 vtbl_max = 0,
129 pure_abstract = 0;
130 set<const FunObjVar*> allVirtualFunctions;
131 for (CHGraph::const_iterator it = chgraph->begin(), eit = chgraph->end();
132 it != eit; ++it)
133 {
134 CHNode *node = it->second;
135 if (node->isPureAbstract())
136 pure_abstract++;
137
138 u32_t vfuncs_size = 0;
139 const vector<CHNode::FuncVector>& vecs = node->getVirtualFunctionVectors();
140 for (vector<CHNode::FuncVector>::const_iterator vit = vecs.begin(),
141 veit = vecs.end(); vit != veit; ++vit)
142 {
143 vfuncs_size += (*vit).size();
144 for (vector<const FunObjVar*>::const_iterator fit = (*vit).begin(),
145 feit = (*vit).end(); fit != feit; ++fit)
146 {
147 const FunObjVar* func = *fit;
148 allVirtualFunctions.insert(func);
149 }
150 }
151 if (vfuncs_size > 0)
152 {
153 vtblnum++;
154 if (vfuncs_size > vtbl_max)
155 {
156 vtbl_max = vfuncs_size;
157 }
158 }
159 }
160 vfunc_total = allVirtualFunctions.size();
161
162 outs() << "vtblnum:\t" << vtblnum << '\n';
163 outs() << "vtbl_average:\t" << (double)(vfunc_total)/vtblnum << '\n';
164 outs() << "vtbl_max:\t" << vtbl_max << '\n';
165 outs() << "pure_abstract:\t" << pure_abstract << '\n';
166}
virtual const std::string & getName() const
Definition CHG.h:127
bool isMultiInheritance() const
Definition CHG.h:161
bool isPureAbstract() const
Definition CHG.h:157
const std::vector< FuncVector > & getVirtualFunctionVectors() const
Definition CHG.h:175
IDToNodeMapTy::const_iterator const_iterator
CommonCHGraph * getCHGraph() const
get CHGraph
CommonCHGraph * chgraph
CHGraph.
std::ostream & errs()
Overwrite llvm::errs().
Definition SVFUtil.h:64
std::ostream & outs()
Overwrite llvm::outs().
Definition SVFUtil.h:58
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
Definition Casting.h:405
unsigned u32_t
Definition GeneralType.h:67

◆ finalize()

void TypeAnalysis::finalize ( )
overridevirtual

Finalize analysis.

Reimplemented from SVF::AndersenBase.

Definition at line 60 of file TypeAnalysis.cpp.

61{
63 if (print_stat)
65}
virtual void finalize() override
Finalize analysis.
Definition Andersen.cpp:97
bool print_stat
User input flags.
void dumpCHAStats()
Statistics of CHA and callgraph.

◆ initialize()

void TypeAnalysis::initialize ( )
overridevirtual

Initialize analysis.

Reimplemented from SVF::AndersenBase.

Definition at line 43 of file TypeAnalysis.cpp.

44{
47 {
49 icfg->dump("icfg_initial");
50 icfg->dump("vfg_initial");
51 if (print_stat)
52 {
53 ICFGStat stat(icfg);
54 stat.performStat();
55 }
56 }
57}
virtual void initialize() override
Initialize analysis.
Definition Andersen.cpp:81
static const Option< bool > DumpICFG
Definition Options.h:121
static PAG * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
Definition PAG.h:121
ICFG * getICFG() const
Definition PAG.h:232
PTAStat * stat
Statistics.
ICFG * icfg
Interprocedural control-flow graph.

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