Static Value-Flow Analysis
Loading...
Searching...
No Matches
CFLStat.cpp
Go to the documentation of this file.
1//===- CFLStat.cpp -- Statistics of CFL Reachability's analysis------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-2017> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * CFLStat.cpp
25 *
26 * Created on: 17 Sep, 2022
27 * Author: Pei Xu
28 */
29
30#include "CFL/CFLStat.h"
31
32using namespace SVF;
33using namespace SVFUtil;
34using namespace std;
35
40{
41 startClk();
42}
43
48{
51
52 timeStatMap["BuildingTime"] = pta->timeOfBuildCFLGraph;
53 PTNumStatMap["NumOfNodes"] = CFLGraph->getTotalNodeNum();
54 PTNumStatMap["NumOfEdges"] = CFLGraph->getCFLEdges().size();
55
56 PTAStat::printStat("CFLGraph Stats");
57}
58
60{
61 timeStatMap["BuildingTime"] = pta->timeOfBuildCFLGrammar;
62 timeStatMap["NormalizationTime"] = pta->timeOfNormalizeGrammar;
63
64 PTAStat::printStat("CFLGrammar Stats");
65}
66
68{
69 timeStatMap["AnalysisTime"] = pta->timeOfSolving;
70 PTNumStatMap["numOfChecks"] = pta->numOfChecks;
71 PTNumStatMap["numOfIteration"] = pta->numOfIteration;
72 PTNumStatMap["SumEdges"] = pta->numOfStartEdges;
73
74 PTAStat::printStat("CFL-reachability Solver Stats");
75}
76
81{
82 assert((SVFUtil::isa<CFLAlias, CFLVF>(pta)) && "not an CFLAlias pass!! what else??");
83 endClk();
84
85 // Grammar stat
87
88 // CFLGraph stat
90
91 // Solver stat
93
94 // Stat about Call graph and General stat
96}
97
cJSON * p
Definition cJSON.cpp:2559
CFL Client Base Class.
Definition CFLBase.h:50
static double timeOfBuildCFLGrammar
Statistics.
Definition CFLBase.h:94
CFLGraph * getCFLGraph()
Get CFL graph.
Definition CFLBase.cpp:145
static double numOfStartEdges
Definition CFLBase.h:101
static double numOfChecks
Definition CFLBase.h:104
virtual void countSumEdges()
Count the num of Nonterminal Edges.
Definition CFLBase.cpp:150
static double timeOfSolving
Definition CFLBase.h:105
static double timeOfBuildCFLGraph
Definition CFLBase.h:97
static double numOfIteration
Definition CFLBase.h:103
static double timeOfNormalizeGrammar
Definition CFLBase.h:95
const CFLEdgeSet & getCFLEdges() const
Definition CFLGraph.h:198
virtual void performStat()
Definition CFLStat.cpp:80
void CFLGrammarStat()
Definition CFLStat.cpp:59
CFLBase * pta
Definition CFLStat.h:47
void CFLGraphStat()
Definition CFLStat.cpp:47
void CFLSolverStat()
Definition CFLStat.cpp:67
CFLStat(CFLBase *p)
Definition CFLStat.cpp:39
u32_t getTotalNodeNum() const
Get total number of node/edge.
void performStat() override
Definition PTAStat.cpp:52
NUMStatMap PTNumStatMap
Definition SVFStat.h:77
virtual void printStat(std::string str="")
Definition SVFStat.cpp:67
virtual void endClk()
Definition SVFStat.h:63
TIMEStatMap timeStatMap
Definition SVFStat.h:78
virtual void startClk()
Definition SVFStat.h:58
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74