Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFStat.h
Go to the documentation of this file.
1//===- SVFStat.h -- Base class for statistics---------------------------------//
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 * SVFStat.h
25 *
26 * Created on: Sep 1, 2022
27 * Author: Xiao Cheng
28 */
29
30#ifndef SVF_SVFSTAT_H
31#define SVF_SVFSTAT_H
32
34
35namespace SVF
36{
37
38
43{
44public:
45
47
49
50 enum class ClockType
51 {
52 Wall,
53 CPU,
54 };
55
56 SVFStat();
57
58 virtual ~SVFStat() {}
59
60 virtual inline void startClk()
61 {
62 startTime = getClk(true);
63 }
64
65 virtual inline void endClk()
66 {
67 endTime = getClk(true);
68 }
69
73 static double getClk(bool mark = false);
74
76 static bool printGeneralStats;
77
81
82 double startTime;
83 double endTime;
84
85 virtual void performStat() = 0;
86
87 virtual void printStat(std::string str = "");
88
89 virtual void performStatPerQuery(NodeID) {}
90
91 virtual void printStatPerQuery(NodeID, const PointsTo &) {}
92
93 virtual void callgraphStat() {}
94
97 static double timeOfBuildingSVFIR;
98
99private:
100 void branchStat();
101 std::string moduleName;
102}; // End class SVFStat
103
104} // End namespace SVF
105#endif //SVF_SVFSTAT_H
NUMStatMap generalNumMap
Definition SVFStat.h:78
NUMStatMap PTNumStatMap
Definition SVFStat.h:79
virtual ~SVFStat()
Definition SVFStat.h:58
virtual void printStat(std::string str="")
Definition SVFStat.cpp:70
void branchStat()
Definition SVFStat.cpp:225
virtual void endClk()
Definition SVFStat.h:65
static bool printGeneralStats
SVF's general statistics are only printed once even if you run multiple anayses.
Definition SVFStat.h:76
virtual void callgraphStat()
Definition SVFStat.h:93
virtual void printStatPerQuery(NodeID, const PointsTo &)
Definition SVFStat.h:91
std::string moduleName
Definition SVFStat.h:101
TIMEStatMap timeStatMap
Definition SVFStat.h:80
virtual void startClk()
Definition SVFStat.h:60
virtual void performStat()=0
Definition SVFStat.cpp:113
double endTime
Definition SVFStat.h:83
OrderedMap< std::string, double > TIMEStatMap
Definition SVFStat.h:48
static double timeOfBuildingLLVMModule
Definition SVFStat.h:95
virtual void performStatPerQuery(NodeID)
Definition SVFStat.h:89
double startTime
Definition SVFStat.h:82
static double getClk(bool mark=false)
Definition SVFStat.cpp:51
OrderedMap< std::string, u32_t > NUMStatMap
Definition SVFStat.h:46
static double timeOfBuildingSymbolTable
Definition SVFStat.h:96
static double timeOfBuildingSVFIR
Definition SVFStat.h:97
for isBitcode
Definition BasicTypes.h:70
u32_t NodeID
Definition GeneralType.h:56
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76