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#include "Util/GeneralType.h"
35
36namespace SVF
37{
38
39
44{
45public:
46
48
50
51 enum class ClockType
52 {
53 Wall,
54 CPU,
55 };
56
57 SVFStat();
58
59 virtual ~SVFStat() {}
60
61 virtual inline void startClk()
62 {
63 startTime = getClk(true);
64 }
65
66 virtual inline void endClk()
67 {
68 endTime = getClk(true);
69 }
70
74 static double getClk(bool mark = false);
75
77 static bool printGeneralStats;
78
82
83 double startTime;
84 double endTime;
85
86 virtual void performStat() = 0;
87
88 virtual void printStat(std::string str = "");
89
90 virtual void performStatPerQuery(NodeID) {}
91
92 virtual void printStatPerQuery(NodeID, const PointsTo &) {}
93
94 virtual void callgraphStat() {}
95
98 static double timeOfBuildingSVFIR;
99
100private:
101 void branchStat();
102 std::string moduleName;
103}; // End class SVFStat
104
105} // End namespace SVF
106#endif //SVF_SVFSTAT_H
NUMStatMap generalNumMap
Definition SVFStat.h:79
NUMStatMap PTNumStatMap
Definition SVFStat.h:80
virtual ~SVFStat()
Definition SVFStat.h:59
virtual void printStat(std::string str="")
Definition SVFStat.cpp:70
void branchStat()
Definition SVFStat.cpp:225
virtual void endClk()
Definition SVFStat.h:66
static bool printGeneralStats
SVF's general statistics are only printed once even if you run multiple anayses.
Definition SVFStat.h:77
virtual void callgraphStat()
Definition SVFStat.h:94
virtual void printStatPerQuery(NodeID, const PointsTo &)
Definition SVFStat.h:92
std::string moduleName
Definition SVFStat.h:102
TIMEStatMap timeStatMap
Definition SVFStat.h:81
virtual void startClk()
Definition SVFStat.h:61
virtual void performStat()=0
Definition SVFStat.cpp:113
double endTime
Definition SVFStat.h:84
OrderedMap< std::string, double > TIMEStatMap
Definition SVFStat.h:49
static double timeOfBuildingLLVMModule
Definition SVFStat.h:96
virtual void performStatPerQuery(NodeID)
Definition SVFStat.h:90
double startTime
Definition SVFStat.h:83
static double getClk(bool mark=false)
Definition SVFStat.cpp:51
OrderedMap< std::string, u32_t > NUMStatMap
Definition SVFStat.h:47
static double timeOfBuildingSymbolTable
Definition SVFStat.h:97
static double timeOfBuildingSVFIR
Definition SVFStat.h:98
for isBitcode
Definition BasicTypes.h:70
u32_t NodeID
Definition GeneralType.h:76
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76