Static Value-Flow Analysis
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 
33 namespace SVF
34 {
35 
36 
40 class SVFStat
41 {
42 public:
43 
45 
47 
48  enum ClockType
49  {
51  CPU,
52  };
53 
54  SVFStat();
55 
56  virtual ~SVFStat() {}
57 
58  virtual inline void startClk()
59  {
60  startTime = getClk(true);
61  }
62 
63  virtual inline void endClk()
64  {
65  endTime = getClk(true);
66  }
67 
71  static double getClk(bool mark = false);
72 
74  static bool printGeneralStats;
75 
79 
80  double startTime;
81  double endTime;
82 
83  virtual void performStat() = 0;
84 
85  virtual void printStat(std::string str = "");
86 
87  virtual void performStatPerQuery(NodeID) {}
88 
89  virtual void printStatPerQuery(NodeID, const PointsTo &) {}
90 
91  virtual void callgraphStat() {}
92 
93  static double timeOfBuildingLLVMModule;
95  static double timeOfBuildingSVFIR;
96 
97 private:
98  void branchStat();
100 }; // End class SVFStat
101 
102 } // End namespace SVF
103 #endif //SVF_SVFSTAT_H
const char *const string
Definition: cJSON.h:172
NUMStatMap generalNumMap
Definition: SVFStat.h:76
NUMStatMap PTNumStatMap
Definition: SVFStat.h:77
virtual ~SVFStat()
Definition: SVFStat.h:56
virtual void printStat(std::string str="")
Definition: SVFStat.cpp:66
void branchStat()
Definition: SVFStat.cpp:215
virtual void endClk()
Definition: SVFStat.h:63
static bool printGeneralStats
SVF's general statistics are only printed once even if you run multiple anayses.
Definition: SVFStat.h:74
virtual void callgraphStat()
Definition: SVFStat.h:91
virtual void printStatPerQuery(NodeID, const PointsTo &)
Definition: SVFStat.h:89
std::string moduleName
Definition: SVFStat.h:99
TIMEStatMap timeStatMap
Definition: SVFStat.h:78
virtual void startClk()
Definition: SVFStat.h:58
virtual void performStat()=0
Definition: SVFStat.cpp:109
double endTime
Definition: SVFStat.h:81
OrderedMap< std::string, double > TIMEStatMap
Definition: SVFStat.h:46
static double timeOfBuildingLLVMModule
Definition: SVFStat.h:93
virtual void performStatPerQuery(NodeID)
Definition: SVFStat.h:87
double startTime
Definition: SVFStat.h:80
static double getClk(bool mark=false)
Definition: SVFStat.cpp:47
OrderedMap< std::string, u32_t > NUMStatMap
Definition: SVFStat.h:44
static double timeOfBuildingSymbolTable
Definition: SVFStat.h:94
static double timeOfBuildingSVFIR
Definition: SVFStat.h:95
for isBitcode
Definition: BasicTypes.h:68
u32_t NodeID
Definition: GeneralType.h:55
std::map< Key, Value, Compare, Allocator > OrderedMap
Definition: GeneralType.h:109