Static Value-Flow Analysis
Loading...
Searching...
No Matches
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
33namespace SVF
34{
35
36class LLVMModuleSet;
37
39{
40
41private:
43
44public:
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
59 CHNode *createNode(const std::string& name);
60
61 void connectInheritEdgeViaCall(const Function* caller, const CallBase* cs);
62 void connectInheritEdgeViaStore(const Function* caller, const StoreInst* store);
63
65 const CHGraph::CHNodeSetTy& getInstancesAndDescendants(const std::string& className);
66
67 void analyzeVTables(const Module &M);
70 const CHNodeSetTy& getCSClasses(const CallBase* cs);
72
73private:
75};
76
77} // End namespace SVF
78
#define F(f)
const char *const name
Definition cJSON.h:264
void analyzeVTables(const Module &M)
void connectInheritEdgeViaStore(const Function *caller, const StoreInst *store)
LLVMModuleSet * llvmModuleSet()
CHGBuilder(CHGraph *c)
Definition CHGBuilder.h:48
void readInheritanceMetadataFromModule(const Module &M)
void buildCHGNodes(const GlobalValue *V)
const CHGraph::CHNodeSetTy & getInstancesAndDescendants(const std::string &className)
CHGraph::WorkList WorkList
Definition CHGBuilder.h:46
void addFuncToFuncVector(CHNode::FuncVector &v, const Function *f)
void buildCHGEdges(const Function *F)
void buildVirtualFunctionToIDMap()
CHGraph * chg
Definition CHGBuilder.h:42
void buildCSToCHAVtblsAndVfnsMap()
void buildInternalMaps()
CHGraph::CHNodeSetTy CHNodeSetTy
Definition CHGBuilder.h:45
const CHNodeSetTy & getCSClasses(const CallBase *cs)
CHNode * createNode(const std::string &name)
void connectInheritEdgeViaCall(const Function *caller, const CallBase *cs)
void buildClassNameToAncestorsDescendantsMap()
Set< const CHNode * > CHNodeSetTy
Definition CHG.h:240
FIFOWorkList< const CHNode * > WorkList
Definition CHG.h:241
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::IRBuilder IRBuilder
Definition BasicTypes.h:74
llvm::Module Module
Definition BasicTypes.h:84
llvm::StoreInst StoreInst
Definition BasicTypes.h:148