Static Value-Flow Analysis
CHGBuilder.h
Go to the documentation of this file.
1 //===----- CHGBuiler.h -- Class hierarchy graph builder ---------------------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-> <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  * CHGBuiler.h
25  *
26  * Created on: Jun 4, 2021
27  * Author: Yulei Sui
28  */
29 
30 #include "Graphs/CHG.h"
31 #include "SVF-LLVM/BasicTypes.h"
32 
33 namespace SVF
34 {
35 
36 class LLVMModuleSet;
37 
39 {
40 
41 private:
43 
44 public:
47 
49  {
50 
51  }
52  void buildCHG();
53  void buildCHGNodes(const GlobalValue *V);
54  void buildCHGNodes(const Function* F);
55  void buildCHGEdges(const Function* F);
56  void buildInternalMaps();
58 
60 
61  void connectInheritEdgeViaCall(const Function* caller, const CallBase* cs);
62  void connectInheritEdgeViaStore(const Function* caller, const StoreInst* store);
63 
66 
67  void analyzeVTables(const Module &M);
70  const CHNodeSetTy& getCSClasses(const CallBase* cs);
72 
73 private:
75 };
76 
77 } // End namespace SVF
78 
#define F(f)
const char *const name
Definition: cJSON.h:264
const char *const string
Definition: cJSON.h:172
void analyzeVTables(const Module &M)
Definition: CHGBuilder.cpp:367
void connectInheritEdgeViaStore(const Function *caller, const StoreInst *store)
Definition: CHGBuilder.cpp:193
LLVMModuleSet * llvmModuleSet()
Definition: CHGBuilder.cpp:60
CHGBuilder(CHGraph *c)
Definition: CHGBuilder.h:48
void readInheritanceMetadataFromModule(const Module &M)
Definition: CHGBuilder.cpp:220
void buildCHGNodes(const GlobalValue *V)
Definition: CHGBuilder.cpp:95
const CHGraph::CHNodeSetTy & getInstancesAndDescendants(const std::string &className)
Definition: CHGBuilder.cpp:301
CHGraph::WorkList WorkList
Definition: CHGBuilder.h:46
void addFuncToFuncVector(CHNode::FuncVector &v, const Function *f)
Definition: CHGBuilder.cpp:740
void buildCHGEdges(const Function *F)
Definition: CHGBuilder.cpp:136
void buildVirtualFunctionToIDMap()
Definition: CHGBuilder.cpp:560
CHGraph * chg
Definition: CHGBuilder.h:42
void buildCSToCHAVtblsAndVfnsMap()
Definition: CHGBuilder.cpp:659
void buildInternalMaps()
Definition: CHGBuilder.cpp:158
CHGraph::CHNodeSetTy CHNodeSetTy
Definition: CHGBuilder.h:45
const CHNodeSetTy & getCSClasses(const CallBase *cs)
Definition: CHGBuilder.cpp:701
CHNode * createNode(const std::string &name)
Definition: CHGBuilder.cpp:241
void connectInheritEdgeViaCall(const Function *caller, const CallBase *cs)
Definition: CHGBuilder.cpp:165
void buildClassNameToAncestorsDescendantsMap()
Definition: CHGBuilder.cpp:268
Set< const CHNode * > CHNodeSetTy
Definition: CHG.h:240
std::vector< const SVFFunction * > FuncVector
Definition: CHG.h:121
for isBitcode
Definition: BasicTypes.h:68
llvm::CallBase CallBase
Definition: BasicTypes.h:146
llvm::Function Function
Definition: BasicTypes.h:85
llvm::GlobalValue GlobalValue
Definition: BasicTypes.h:88
llvm::Module Module
Definition: BasicTypes.h:84
llvm::StoreInst StoreInst
Definition: BasicTypes.h:148