svf-lib 1.0.2157 → 1.0.2158
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/SVF-linux/Release-build/bin/ae +0 -0
- package/SVF-linux/Release-build/bin/cfl +0 -0
- package/SVF-linux/Release-build/bin/dvf +0 -0
- package/SVF-linux/Release-build/bin/llvm2svf +0 -0
- package/SVF-linux/Release-build/bin/mta +0 -0
- package/SVF-linux/Release-build/bin/saber +0 -0
- package/SVF-linux/Release-build/bin/svf-ex +0 -0
- package/SVF-linux/Release-build/bin/wpa +0 -0
- package/SVF-linux/Release-build/include/SVF-LLVM/ICFGBuilder.h +2 -29
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMModule.h +24 -7
- package/SVF-linux/Release-build/include/SVFIR/SVFFileSystem.h +0 -3
- package/SVF-linux/Release-build/include/SVFIR/SVFValue.h +0 -60
- package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -58,44 +58,17 @@ private:
|
|
|
58
58
|
public:
|
|
59
59
|
typedef FIFOWorkList<const Instruction*> WorkList;
|
|
60
60
|
|
|
61
|
-
ICFGBuilder()
|
|
62
|
-
{
|
|
61
|
+
ICFGBuilder() = default;
|
|
63
62
|
|
|
64
|
-
}
|
|
65
63
|
ICFG* build();
|
|
66
64
|
|
|
67
65
|
private:
|
|
68
66
|
|
|
69
|
-
LLVMModuleSet* llvmModuleSet()
|
|
67
|
+
inline LLVMModuleSet* llvmModuleSet()
|
|
70
68
|
{
|
|
71
69
|
return LLVMModuleSet::getLLVMModuleSet();
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
CSToRetNodeMapTy& csToRetNodeMap()
|
|
75
|
-
{
|
|
76
|
-
return llvmModuleSet()->CSToRetNodeMap;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
CSToCallNodeMapTy& csToCallNodeMap()
|
|
80
|
-
{
|
|
81
|
-
return llvmModuleSet()->CSToCallNodeMap;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
InstToBlockNodeMapTy& instToBlockNodeMap()
|
|
85
|
-
{
|
|
86
|
-
return llvmModuleSet()->InstToBlockNodeMap;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
FunToFunEntryNodeMapTy& funToFunEntryNodeMap()
|
|
90
|
-
{
|
|
91
|
-
return llvmModuleSet()->FunToFunEntryNodeMap;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
FunToFunExitNodeMapTy& funToFunExitNodeMap()
|
|
95
|
-
{
|
|
96
|
-
return llvmModuleSet()->FunToFunExitNodeMap;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
72
|
private:
|
|
100
73
|
|
|
101
74
|
/// Create edges between ICFG nodes within a function
|
|
@@ -172,7 +172,8 @@ public:
|
|
|
172
172
|
LLVMFunc2SVFFunc[func] = svfFunc;
|
|
173
173
|
setValueAttr(func,svfFunc);
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
|
|
176
|
+
void addFunctionMap(const Function* func, CallGraphNode* svfFunc);
|
|
176
177
|
|
|
177
178
|
inline void addBasicBlockMap(const BasicBlock* bb, SVFBasicBlock* svfBB)
|
|
178
179
|
{
|
|
@@ -184,6 +185,22 @@ public:
|
|
|
184
185
|
LLVMInst2SVFInst[inst] = svfInst;
|
|
185
186
|
setValueAttr(inst,svfInst);
|
|
186
187
|
}
|
|
188
|
+
inline void addInstructionMap(const Instruction* inst, CallICFGNode* svfInst)
|
|
189
|
+
{
|
|
190
|
+
CSToCallNodeMap[inst] = svfInst;
|
|
191
|
+
setValueAttr(inst,svfInst);
|
|
192
|
+
}
|
|
193
|
+
inline void addInstructionMap(const Instruction* inst, RetICFGNode* svfInst)
|
|
194
|
+
{
|
|
195
|
+
CSToRetNodeMap[inst] = svfInst;
|
|
196
|
+
setValueAttr(inst,svfInst);
|
|
197
|
+
}
|
|
198
|
+
inline void addInstructionMap(const Instruction* inst, IntraICFGNode* svfInst)
|
|
199
|
+
{
|
|
200
|
+
InstToBlockNodeMap[inst] = svfInst;
|
|
201
|
+
setValueAttr(inst,svfInst);
|
|
202
|
+
}
|
|
203
|
+
|
|
187
204
|
inline void addArgumentMap(const Argument* arg, SVFArgument* svfArg)
|
|
188
205
|
{
|
|
189
206
|
LLVMArgument2SVFArgument[arg] = svfArg;
|
|
@@ -231,17 +248,17 @@ public:
|
|
|
231
248
|
return it->second;
|
|
232
249
|
}
|
|
233
250
|
|
|
234
|
-
inline
|
|
251
|
+
inline CallGraphNode* getCallGraphNode(const Function* fun) const
|
|
235
252
|
{
|
|
236
|
-
|
|
237
|
-
assert(it!=
|
|
253
|
+
LLVMFun2CallGraphNodeMap::const_iterator it = LLVMFunc2CallGraphNode.find(fun);
|
|
254
|
+
assert(it!=LLVMFunc2CallGraphNode.end() && "SVF Function not found!");
|
|
238
255
|
return it->second;
|
|
239
256
|
}
|
|
240
257
|
|
|
241
|
-
inline
|
|
258
|
+
inline SVFFunction* getSVFFunction(const Function* fun) const
|
|
242
259
|
{
|
|
243
|
-
|
|
244
|
-
assert(it!=
|
|
260
|
+
LLVMFun2SVFFunMap::const_iterator it = LLVMFunc2SVFFunc.find(fun);
|
|
261
|
+
assert(it!=LLVMFunc2SVFFunc.end() && "SVF Function not found!");
|
|
245
262
|
return it->second;
|
|
246
263
|
}
|
|
247
264
|
|
|
@@ -116,7 +116,6 @@ class SVFFunction;
|
|
|
116
116
|
class SVFBasicBlock;
|
|
117
117
|
class SVFInstruction;
|
|
118
118
|
class SVFCallInst;
|
|
119
|
-
class SVFVirtualCallInst;
|
|
120
119
|
class SVFConstant;
|
|
121
120
|
class SVFGlobalValue;
|
|
122
121
|
class SVFArgument;
|
|
@@ -516,7 +515,6 @@ private:
|
|
|
516
515
|
cJSON* contentToJson(const SVFBasicBlock* value);
|
|
517
516
|
cJSON* contentToJson(const SVFInstruction* value);
|
|
518
517
|
cJSON* contentToJson(const SVFCallInst* value);
|
|
519
|
-
cJSON* contentToJson(const SVFVirtualCallInst* value);
|
|
520
518
|
cJSON* contentToJson(const SVFConstant* value);
|
|
521
519
|
cJSON* contentToJson(const SVFGlobalValue* value);
|
|
522
520
|
cJSON* contentToJson(const SVFArgument* value);
|
|
@@ -1290,7 +1288,6 @@ private:
|
|
|
1290
1288
|
void fill(const cJSON*& fieldJson, SVFBasicBlock* value);
|
|
1291
1289
|
void fill(const cJSON*& fieldJson, SVFInstruction* value);
|
|
1292
1290
|
void fill(const cJSON*& fieldJson, SVFCallInst* value);
|
|
1293
|
-
void fill(const cJSON*& fieldJson, SVFVirtualCallInst* value);
|
|
1294
1291
|
void fill(const cJSON*& fieldJson, SVFConstant* value);
|
|
1295
1292
|
void fill(const cJSON*& fieldJson, SVFGlobalValue* value);
|
|
1296
1293
|
void fill(const cJSON*& fieldJson, SVFArgument* value);
|
|
@@ -746,66 +746,6 @@ public:
|
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
748
|
|
|
749
|
-
class SVFVirtualCallInst : public SVFCallInst
|
|
750
|
-
{
|
|
751
|
-
friend class SVFIRWriter;
|
|
752
|
-
friend class SVFIRReader;
|
|
753
|
-
friend class LLVMModuleSet;
|
|
754
|
-
|
|
755
|
-
private:
|
|
756
|
-
const SVFValue* vCallVtblPtr; /// virtual table pointer
|
|
757
|
-
s32_t virtualFunIdx; /// virtual function index of the virtual table(s) at a virtual call
|
|
758
|
-
std::string funNameOfVcall; /// the function name of this virtual call
|
|
759
|
-
|
|
760
|
-
protected:
|
|
761
|
-
inline void setFunIdxInVtable(s32_t idx)
|
|
762
|
-
{
|
|
763
|
-
virtualFunIdx = idx;
|
|
764
|
-
}
|
|
765
|
-
inline void setFunNameOfVirtualCall(const std::string& name)
|
|
766
|
-
{
|
|
767
|
-
funNameOfVcall = name;
|
|
768
|
-
}
|
|
769
|
-
inline void setVtablePtr(const SVFValue* vptr)
|
|
770
|
-
{
|
|
771
|
-
vCallVtblPtr = vptr;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
public:
|
|
775
|
-
SVFVirtualCallInst(const SVFType* ty, const SVFBasicBlock* b, bool vararg,
|
|
776
|
-
bool tm)
|
|
777
|
-
: SVFCallInst(ty, b, vararg, tm, SVFVCall), vCallVtblPtr(nullptr),
|
|
778
|
-
virtualFunIdx(-1), funNameOfVcall()
|
|
779
|
-
{
|
|
780
|
-
}
|
|
781
|
-
inline const SVFValue* getVtablePtr() const
|
|
782
|
-
{
|
|
783
|
-
assert(vCallVtblPtr && "virtual call does not have a vtblptr? set it first");
|
|
784
|
-
return vCallVtblPtr;
|
|
785
|
-
}
|
|
786
|
-
inline s32_t getFunIdxInVtable() const
|
|
787
|
-
{
|
|
788
|
-
assert(virtualFunIdx >=0 && "virtual function idx is less than 0? not set yet?");
|
|
789
|
-
return virtualFunIdx;
|
|
790
|
-
}
|
|
791
|
-
inline const std::string& getFunNameOfVirtualCall() const
|
|
792
|
-
{
|
|
793
|
-
return funNameOfVcall;
|
|
794
|
-
}
|
|
795
|
-
static inline bool classof(const SVFValue *node)
|
|
796
|
-
{
|
|
797
|
-
return node->getKind() == SVFVCall;
|
|
798
|
-
}
|
|
799
|
-
static inline bool classof(const SVFInstruction *node)
|
|
800
|
-
{
|
|
801
|
-
return node->getKind() == SVFVCall;
|
|
802
|
-
}
|
|
803
|
-
static inline bool classof(const SVFCallInst *node)
|
|
804
|
-
{
|
|
805
|
-
return node->getKind() == SVFVCall;
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
|
|
809
749
|
class SVFConstant : public SVFValue
|
|
810
750
|
{
|
|
811
751
|
friend class SVFIRWriter;
|
|
Binary file
|
|
Binary file
|