Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
SVF::ICFGStat Class Reference

#include <ICFGStat.h>

Inheritance diagram for SVF::ICFGStat:
SVF::PTAStat SVF::SVFStat

Public Types

typedef Set< const ICFGNode * > ICFGNodeSet
 
- Public Types inherited from SVF::SVFStat
enum  ClockType { Wall , CPU }
 
typedef OrderedMap< std::string, u32_tNUMStatMap
 
typedef OrderedMap< std::string, doubleTIMEStatMap
 

Public Member Functions

 ICFGStat (ICFG *cfg)
 
void performStat ()
 
void performStatforIFDS ()
 
void countStat ()
 
void printStat (std::string statname)
 
- Public Member Functions inherited from SVF::PTAStat
 PTAStat (PointerAnalysis *p)
 
virtual ~PTAStat ()
 
void setMemUsageBefore (u32_t vmrss, u32_t vmsize)
 
void setMemUsageAfter (u32_t vmrss, u32_t vmsize)
 
void performStat () override
 
void callgraphStat () override
 
- Public Member Functions inherited from SVF::SVFStat
 SVFStat ()
 
virtual ~SVFStat ()
 
virtual void startClk ()
 
virtual void endClk ()
 
virtual void performStatPerQuery (NodeID)
 
virtual void printStatPerQuery (NodeID, const PointsTo &)
 

Private Attributes

ICFGicfg
 
int numOfNodes
 
int numOfCallNodes
 
int numOfRetNodes
 
int numOfEntryNodes
 
int numOfExitNodes
 
int numOfIntraNodes
 
int numOfEdges
 
int numOfCallEdges
 
int numOfRetEdges
 
int numOfIntraEdges
 

Additional Inherited Members

- Static Public Member Functions inherited from SVF::SVFStat
static double getClk (bool mark=false)
 
- Public Attributes inherited from SVF::PTAStat
NodeBS localVarInRecursion
 
- Public Attributes inherited from SVF::SVFStat
NUMStatMap generalNumMap
 
NUMStatMap PTNumStatMap
 
TIMEStatMap timeStatMap
 
double startTime
 
double endTime
 
- Static Public Attributes inherited from SVF::SVFStat
static bool printGeneralStats = true
 SVF's general statistics are only printed once even if you run multiple anayses.
 
static double timeOfBuildingLLVMModule = 0
 
static double timeOfBuildingSymbolTable = 0
 
static double timeOfBuildingSVFIR = 0
 
- Protected Attributes inherited from SVF::PTAStat
PointerAnalysispta
 
u32_t _vmrssUsageBefore
 
u32_t _vmrssUsageAfter
 
u32_t _vmsizeUsageBefore
 
u32_t _vmsizeUsageAfter
 

Detailed Description

Definition at line 39 of file ICFGStat.h.

Member Typedef Documentation

◆ ICFGNodeSet

Definition at line 57 of file ICFGStat.h.

Constructor & Destructor Documentation

◆ ICFGStat()

SVF::ICFGStat::ICFGStat ( ICFG cfg)
inline

Definition at line 59 of file ICFGStat.h.

59 : PTAStat(nullptr), icfg(cfg)
60 {
61 numOfNodes = 0;
63 numOfRetNodes = 0;
67
68 numOfEdges = 0;
70 numOfRetEdges = 0;
72
73 }
ICFG * icfg
Definition ICFGStat.h:43
int numOfRetEdges
Definition ICFGStat.h:53
int numOfIntraEdges
Definition ICFGStat.h:54
int numOfCallNodes
Definition ICFGStat.h:45
int numOfCallEdges
Definition ICFGStat.h:52
int numOfRetNodes
Definition ICFGStat.h:46
int numOfEntryNodes
Definition ICFGStat.h:47
int numOfExitNodes
Definition ICFGStat.h:48
int numOfIntraNodes
Definition ICFGStat.h:49
PTAStat(PointerAnalysis *p)
Definition PTAStat.cpp:39
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ countStat()

void SVF::ICFGStat::countStat ( )
inline

Definition at line 105 of file ICFGStat.h.

106 {
107 ICFG::ICFGNodeIDToNodeMapTy::iterator it = icfg->begin();
108 ICFG::ICFGNodeIDToNodeMapTy::iterator eit = icfg->end();
109 for (; it != eit; ++it)
110 {
111 numOfNodes++;
112
113 ICFGNode *node = it->second;
114
115 if (SVFUtil::isa<IntraICFGNode>(node))
117 else if (SVFUtil::isa<CallICFGNode>(node))
119 else if (SVFUtil::isa<RetICFGNode>(node))
121 else if (SVFUtil::isa<FunEntryICFGNode>(node))
123 else if (SVFUtil::isa<FunExitICFGNode>(node))
125
126
127 ICFGEdge::ICFGEdgeSetTy::iterator edgeIt =
128 it->second->OutEdgeBegin();
129 ICFGEdge::ICFGEdgeSetTy::iterator edgeEit =
130 it->second->OutEdgeEnd();
131 for (; edgeIt != edgeEit; ++edgeIt)
132 {
133 const ICFGEdge *edge = *edgeIt;
134 numOfEdges++;
135 if (edge->isCallCFGEdge())
137 else if (edge->isRetCFGEdge())
139 else if (edge->isIntraCFGEdge())
141 }
142 }
143 }
iterator begin()
Iterators.

◆ performStat()

void SVF::ICFGStat::performStat ( )
inlinevirtual

Implements SVF::SVFStat.

Definition at line 75 of file ICFGStat.h.

76 {
77
78 countStat();
79
80 PTNumStatMap["ICFGNode"] = numOfNodes;
81 PTNumStatMap["IntraICFGNode"] = numOfIntraNodes;
82 PTNumStatMap["CallICFGNode"] = numOfCallNodes;
83 PTNumStatMap["RetICFGNode"] = numOfRetNodes;
84 PTNumStatMap["FunEntryICFGNode"] = numOfEntryNodes;
85 PTNumStatMap["FunExitICFGNode"] = numOfExitNodes;
86
87 PTNumStatMap["ICFGEdge"] = numOfEdges;
88 PTNumStatMap["CallCFGEdge"] = numOfCallEdges;
89 PTNumStatMap["RetCFGEdge"] = numOfRetEdges;
90 PTNumStatMap["IntraCFGEdge"] = numOfIntraEdges;
91
92 printStat("ICFG Stat");
93 }
void countStat()
Definition ICFGStat.h:105
void printStat(std::string statname)
Definition ICFGStat.h:145
NUMStatMap PTNumStatMap
Definition SVFStat.h:77

◆ performStatforIFDS()

void SVF::ICFGStat::performStatforIFDS ( )
inline

Definition at line 95 of file ICFGStat.h.

96 {
97
98 countStat();
99 PTNumStatMap["ICFGNode(N)"] = numOfNodes;
100 PTNumStatMap["CallICFGNode(Call)"] = numOfCallNodes;
101 PTNumStatMap["ICFGEdge(E)"] = numOfEdges;
102 printStat("IFDS Stat");
103 }

◆ printStat()

void SVF::ICFGStat::printStat ( std::string  statname)
inlinevirtual

Reimplemented from SVF::SVFStat.

Definition at line 145 of file ICFGStat.h.

146 {
147
148 SVFUtil::outs() << "\n************ " << statname << " ***************\n";
149 SVFUtil::outs().flags(std::ios::left);
150 unsigned field_width = 20;
151 for(NUMStatMap::iterator it = PTNumStatMap.begin(), eit = PTNumStatMap.end(); it!=eit; ++it)
152 {
153 // format out put with width 20 space
154 SVFUtil::outs() << std::setw(field_width) << it->first << it->second << "\n";
155 }
156 PTNumStatMap.clear();
157 SVFUtil::outs().flush();
158 }
std::ostream & outs()
Overwrite llvm::outs()
Definition SVFUtil.h:50

Member Data Documentation

◆ icfg

ICFG* SVF::ICFGStat::icfg
private

Definition at line 43 of file ICFGStat.h.

◆ numOfCallEdges

int SVF::ICFGStat::numOfCallEdges
private

Definition at line 52 of file ICFGStat.h.

◆ numOfCallNodes

int SVF::ICFGStat::numOfCallNodes
private

Definition at line 45 of file ICFGStat.h.

◆ numOfEdges

int SVF::ICFGStat::numOfEdges
private

Definition at line 51 of file ICFGStat.h.

◆ numOfEntryNodes

int SVF::ICFGStat::numOfEntryNodes
private

Definition at line 47 of file ICFGStat.h.

◆ numOfExitNodes

int SVF::ICFGStat::numOfExitNodes
private

Definition at line 48 of file ICFGStat.h.

◆ numOfIntraEdges

int SVF::ICFGStat::numOfIntraEdges
private

Definition at line 54 of file ICFGStat.h.

◆ numOfIntraNodes

int SVF::ICFGStat::numOfIntraNodes
private

Definition at line 49 of file ICFGStat.h.

◆ numOfNodes

int SVF::ICFGStat::numOfNodes
private

Definition at line 44 of file ICFGStat.h.

◆ numOfRetEdges

int SVF::ICFGStat::numOfRetEdges
private

Definition at line 53 of file ICFGStat.h.

◆ numOfRetNodes

int SVF::ICFGStat::numOfRetNodes
private

Definition at line 46 of file ICFGStat.h.


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