svf-lib 1.0.1301 → 1.0.1302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/SVF-linux/include/SVF-FE/BasicTypes.h +0 -219
- package/SVF-linux/include/SVF-FE/BreakConstantExpr.h +0 -94
- package/SVF-linux/include/SVF-FE/CHG.h +0 -334
- package/SVF-linux/include/SVF-FE/CHGBuilder.h +0 -73
- package/SVF-linux/include/SVF-FE/CPPUtil.h +0 -130
- package/SVF-linux/include/SVF-FE/CallGraphBuilder.h +0 -74
- package/SVF-linux/include/SVF-FE/CommonCHG.h +0 -49
- package/SVF-linux/include/SVF-FE/DCHG.h +0 -470
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +0 -190
- package/SVF-linux/include/SVF-FE/GEPTypeBridgeIterator.h +0 -183
- package/SVF-linux/include/SVF-FE/Graph2Json.h +0 -30
- package/SVF-linux/include/SVF-FE/ICFGBuilder.h +0 -106
- package/SVF-linux/include/SVF-FE/IRAnnotator.h +0 -323
- package/SVF-linux/include/SVF-FE/LLVMLoopAnalysis.h +0 -59
- package/SVF-linux/include/SVF-FE/LLVMModule.h +0 -319
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +0 -303
- package/SVF-linux/include/SVF-FE/LocMemModel.h +0 -35
- package/SVF-linux/include/SVF-FE/MemModelBuilder.h +0 -102
- package/SVF-linux/include/SVF-FE/PAGBuilder.h +0 -390
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +0 -412
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +0 -99
- package/SVF-linux/include/SVF-FE/SymbolTableInfo.h +0 -439
- package/SVF-osx/include/SVF-FE/BasicTypes.h +0 -219
- package/SVF-osx/include/SVF-FE/BreakConstantExpr.h +0 -94
- package/SVF-osx/include/SVF-FE/CHG.h +0 -334
- package/SVF-osx/include/SVF-FE/CHGBuilder.h +0 -73
- package/SVF-osx/include/SVF-FE/CPPUtil.h +0 -130
- package/SVF-osx/include/SVF-FE/CallGraphBuilder.h +0 -74
- package/SVF-osx/include/SVF-FE/CommonCHG.h +0 -49
- package/SVF-osx/include/SVF-FE/DCHG.h +0 -470
- package/SVF-osx/include/SVF-FE/DataFlowUtil.h +0 -190
- package/SVF-osx/include/SVF-FE/GEPTypeBridgeIterator.h +0 -183
- package/SVF-osx/include/SVF-FE/Graph2Json.h +0 -30
- package/SVF-osx/include/SVF-FE/ICFGBuilder.h +0 -106
- package/SVF-osx/include/SVF-FE/IRAnnotator.h +0 -323
- package/SVF-osx/include/SVF-FE/LLVMLoopAnalysis.h +0 -59
- package/SVF-osx/include/SVF-FE/LLVMModule.h +0 -319
- package/SVF-osx/include/SVF-FE/LLVMUtil.h +0 -303
- package/SVF-osx/include/SVF-FE/LocMemModel.h +0 -35
- package/SVF-osx/include/SVF-FE/MemModelBuilder.h +0 -102
- package/SVF-osx/include/SVF-FE/PAGBuilder.h +0 -390
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +0 -412
- package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +0 -99
- package/SVF-osx/include/SVF-FE/SymbolTableInfo.h +0 -439
|
@@ -1,73 +0,0 @@
|
|
|
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 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 General Public License for more details.
|
|
17
|
-
|
|
18
|
-
// You should have received a copy of the GNU 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-FE/BasicTypes.h"
|
|
32
|
-
|
|
33
|
-
namespace SVF
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
class CHGBuilder
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
private:
|
|
40
|
-
CHGraph* chg;
|
|
41
|
-
|
|
42
|
-
public:
|
|
43
|
-
typedef CHGraph::CHNodeSetTy CHNodeSetTy;
|
|
44
|
-
typedef CHGraph::WorkList WorkList;
|
|
45
|
-
|
|
46
|
-
CHGBuilder(CHGraph* c): chg(c)
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
void buildCHG();
|
|
51
|
-
void buildCHGNodes(const GlobalValue *V);
|
|
52
|
-
void buildCHGNodes(const SVFFunction* F);
|
|
53
|
-
void buildCHGEdges(const SVFFunction* F);
|
|
54
|
-
void buildInternalMaps();
|
|
55
|
-
void readInheritanceMetadataFromModule(const Module &M);
|
|
56
|
-
|
|
57
|
-
CHNode *createNode(const std::string name);
|
|
58
|
-
|
|
59
|
-
void connectInheritEdgeViaCall(const SVFFunction* caller, CallSite cs);
|
|
60
|
-
void connectInheritEdgeViaStore(const SVFFunction* caller, const StoreInst* store);
|
|
61
|
-
|
|
62
|
-
void buildClassNameToAncestorsDescendantsMap();
|
|
63
|
-
const CHGraph::CHNodeSetTy& getInstancesAndDescendants(const std::string className);
|
|
64
|
-
|
|
65
|
-
void analyzeVTables(const Module &M);
|
|
66
|
-
void buildVirtualFunctionToIDMap();
|
|
67
|
-
void buildCSToCHAVtblsAndVfnsMap();
|
|
68
|
-
const CHNodeSetTy& getCSClasses(CallSite cs);
|
|
69
|
-
void addFuncToFuncVector(CHNode::FuncVector &v, const SVFFunction *f);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
} // End namespace SVF
|
|
73
|
-
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
//===- CPPUtil.h -- Base class of pointer analyses ---------------------------//
|
|
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 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 General Public License for more details.
|
|
17
|
-
|
|
18
|
-
// You should have received a copy of the GNU General Public License
|
|
19
|
-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
//
|
|
21
|
-
//===----------------------------------------------------------------------===//
|
|
22
|
-
|
|
23
|
-
/*
|
|
24
|
-
* CPPUtil.h
|
|
25
|
-
*
|
|
26
|
-
* Created on: Apr 13, 2016
|
|
27
|
-
* Author: Xiaokang Fan
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
#ifndef CPPUtil_H_
|
|
31
|
-
#define CPPUtil_H_
|
|
32
|
-
|
|
33
|
-
#include "Util/BasicTypes.h"
|
|
34
|
-
#include "SVF-FE/BasicTypes.h"
|
|
35
|
-
|
|
36
|
-
namespace SVF
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
class CHGraph;
|
|
40
|
-
/*
|
|
41
|
-
* Util class to assist pointer analysis for cpp programs
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
namespace cppUtil
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
struct DemangledName
|
|
48
|
-
{
|
|
49
|
-
std::string className;
|
|
50
|
-
std::string funcName;
|
|
51
|
-
bool isThunkFunc;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
struct DemangledName demangle(const std::string &name);
|
|
55
|
-
|
|
56
|
-
std::string getBeforeBrackets(const std::string &name);
|
|
57
|
-
bool isValVtbl(const Value* val);
|
|
58
|
-
bool isLoadVtblInst(const LoadInst *loadInst);
|
|
59
|
-
bool isVirtualCallSite(CallSite cs);
|
|
60
|
-
bool isConstructor(const Function* F);
|
|
61
|
-
bool isDestructor(const Function* F);
|
|
62
|
-
bool isCPPThunkFunction(const Function* F);
|
|
63
|
-
const Function* getThunkTarget(const Function* F);
|
|
64
|
-
|
|
65
|
-
/*
|
|
66
|
-
* VtableA = {&A::foo}
|
|
67
|
-
* A::A(this){
|
|
68
|
-
* *this = &VtableA;
|
|
69
|
-
* }
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* A* p = new A;
|
|
73
|
-
* cs: p->foo(...)
|
|
74
|
-
* ==>
|
|
75
|
-
* vtptr = *p;
|
|
76
|
-
* vfn = &vtptr[i]
|
|
77
|
-
* %funp = *vfn
|
|
78
|
-
* call %funp(p,...)
|
|
79
|
-
* getConstructorThisPtr(A) return "this" pointer
|
|
80
|
-
* getVCallThisPtr(cs) return p (this pointer)
|
|
81
|
-
* getVCallVtblPtr(cs) return vtptr
|
|
82
|
-
* getVCallIdx(cs) return i
|
|
83
|
-
* getClassNameFromVtblObj(VtableA) return
|
|
84
|
-
* getClassNameFromType(type of p) return type A
|
|
85
|
-
*/
|
|
86
|
-
const Argument* getConstructorThisPtr(const Function* fun);
|
|
87
|
-
const Value* getVCallThisPtr(CallSite cs);
|
|
88
|
-
const Value* getVCallVtblPtr(CallSite cs);
|
|
89
|
-
u64_t getVCallIdx(CallSite cs);
|
|
90
|
-
std::string getClassNameFromVtblObj(const Value* value);
|
|
91
|
-
std::string getClassNameFromType(const Type *ty);
|
|
92
|
-
std::string getClassNameOfThisPtr(CallSite cs);
|
|
93
|
-
std::string getFunNameOfVCallSite(CallSite cs);
|
|
94
|
-
bool VCallInCtorOrDtor(CallSite cs);
|
|
95
|
-
|
|
96
|
-
/*
|
|
97
|
-
* A(A* this){
|
|
98
|
-
* store this this.addr;
|
|
99
|
-
* tmp = load this.addr;
|
|
100
|
-
* this1 = bitcast(tmp);
|
|
101
|
-
* B(this1);
|
|
102
|
-
* }
|
|
103
|
-
* this and this1 are the same thisPtr in the constructor
|
|
104
|
-
*/
|
|
105
|
-
bool isSameThisPtrInConstructor(const Argument* thisPtr1, const Value* thisPtr2);
|
|
106
|
-
|
|
107
|
-
/// Constants pertaining to CTir, for C and C++.
|
|
108
|
-
/// TODO: move helper functions here too?
|
|
109
|
-
namespace ctir
|
|
110
|
-
{
|
|
111
|
-
/// On loads, stores, GEPs representing dereferences, and calls
|
|
112
|
-
/// representing virtual calls.
|
|
113
|
-
/// (The static type.)
|
|
114
|
-
const std::string derefMDName = "ctir";
|
|
115
|
-
/// On the (global) virtual table itself.
|
|
116
|
-
/// (The class it corresponds to.)
|
|
117
|
-
const std::string vtMDName = "ctir.vt";
|
|
118
|
-
/// On the bitcast of `this` to i8*.
|
|
119
|
-
/// (The class the constructor it corresponds to.)
|
|
120
|
-
const std::string vtInitMDName = "ctir.vt.init";
|
|
121
|
-
|
|
122
|
-
/// Value we expect a ctir-annotated module to have.
|
|
123
|
-
const uint32_t moduleFlagValue = 1;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
} // End namespace cppUtil
|
|
127
|
-
|
|
128
|
-
} // End namespace SVF
|
|
129
|
-
|
|
130
|
-
#endif /* CPPUtil_H_ */
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
//===- CallGraphBuilder.h ----------------------------------------------------------------//
|
|
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 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 General Public License for more details.
|
|
17
|
-
|
|
18
|
-
// You should have received a copy of the GNU General Public License
|
|
19
|
-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
//
|
|
21
|
-
//===----------------------------------------------------------------------===//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/*
|
|
25
|
-
* CallGraphBuilder.h
|
|
26
|
-
*
|
|
27
|
-
* Created on: 13Mar.,2020
|
|
28
|
-
* Author: Yulei Sui
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
#ifndef INCLUDE_SVF_FE_CALLGRAPHBUILDER_H_
|
|
32
|
-
#define INCLUDE_SVF_FE_CALLGRAPHBUILDER_H_
|
|
33
|
-
|
|
34
|
-
#include "Graphs/PTACallGraph.h"
|
|
35
|
-
#include "Graphs/ThreadCallGraph.h"
|
|
36
|
-
|
|
37
|
-
namespace SVF
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
class ICFG;
|
|
41
|
-
|
|
42
|
-
class CallGraphBuilder
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
protected:
|
|
46
|
-
PTACallGraph* callgraph;
|
|
47
|
-
ICFG* icfg;
|
|
48
|
-
public:
|
|
49
|
-
CallGraphBuilder(PTACallGraph* cg, ICFG* i): callgraph(cg),icfg(i)
|
|
50
|
-
{
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/// Build normal callgraph
|
|
54
|
-
PTACallGraph* buildCallGraph(SVFModule* svfModule);
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
class ThreadCallGraphBuilder : public CallGraphBuilder
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
public:
|
|
62
|
-
ThreadCallGraphBuilder(ThreadCallGraph* cg, ICFG* i): CallGraphBuilder(cg,i)
|
|
63
|
-
{
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/// Build thread-aware callgraph
|
|
67
|
-
PTACallGraph* buildThreadCallGraph(SVFModule* svfModule);
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
} // End namespace SVF
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
#endif /* INCLUDE_UTIL_CALLGRAPHBUILDER_H_ */
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//===----- CommonCHG.h -- Base class of CHG implementations ------------------//
|
|
2
|
-
// A common base to CHGraph and DCHGraph.
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
* CommonCHG.h
|
|
6
|
-
*
|
|
7
|
-
* Created on: Aug 24, 2019
|
|
8
|
-
* Author: Mohamad Barbar
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#ifndef COMMONCHG_H_
|
|
12
|
-
#define COMMONCHG_H_
|
|
13
|
-
|
|
14
|
-
namespace SVF
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
typedef Set<const GlobalValue*> VTableSet;
|
|
18
|
-
typedef Set<const SVFFunction*> VFunSet;
|
|
19
|
-
|
|
20
|
-
/// Common base for class hierarchy graph. Only implements what PointerAnalysis needs.
|
|
21
|
-
class CommonCHGraph
|
|
22
|
-
{
|
|
23
|
-
public:
|
|
24
|
-
virtual ~CommonCHGraph() { };
|
|
25
|
-
enum CHGKind
|
|
26
|
-
{
|
|
27
|
-
Standard,
|
|
28
|
-
DI
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
virtual bool csHasVFnsBasedonCHA(CallSite cs) = 0;
|
|
32
|
-
virtual const VFunSet &getCSVFsBasedonCHA(CallSite cs) = 0;
|
|
33
|
-
virtual bool csHasVtblsBasedonCHA(CallSite cs) = 0;
|
|
34
|
-
virtual const VTableSet &getCSVtblsBasedonCHA(CallSite cs) = 0;
|
|
35
|
-
virtual void getVFnsFromVtbls(CallSite cs, const VTableSet &vtbls, VFunSet &virtualFunctions) = 0;
|
|
36
|
-
|
|
37
|
-
CHGKind getKind(void) const
|
|
38
|
-
{
|
|
39
|
-
return kind;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
protected:
|
|
43
|
-
CHGKind kind;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
} // End namespace SVF
|
|
47
|
-
|
|
48
|
-
#endif /* COMMONCHG_H_ */
|
|
49
|
-
|