svf-lib 1.0.1204 → 1.0.1207

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.
@@ -43,9 +43,6 @@ public:
43
43
  /// We start from here
44
44
  virtual void runOnModule(SVFModule* module);
45
45
 
46
- /// We start from here
47
- virtual bool runOnModule(Module& module);
48
-
49
46
  /// Select a client
50
47
  virtual void selectClient(SVFModule* module);
51
48
 
@@ -38,6 +38,7 @@ typedef llvm::UnifyFunctionExitNodesLegacyPass UnifyFunctionExitNodes;
38
38
  typedef llvm::UnifyFunctionExitNodes UnifyFunctionExitNodes;
39
39
  #endif
40
40
 
41
+ typedef llvm::Module Module;
41
42
 
42
43
  typedef llvm::SMDiagnostic SMDiagnostic;
43
44
 
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  #include "Graphs/CHG.h"
31
+ #include "SVF-FE/BasicTypes.h"
31
32
 
32
33
  namespace SVF
33
34
  {
@@ -386,7 +386,7 @@ private:
386
386
  void handleDISubroutineType(const DISubroutineType *subroutineType);
387
387
 
388
388
  /// Finds all defined virtual functions and attaches them to nodes.
389
- void buildVTables(const Module &module);
389
+ void buildVTables(const SVFModule &module);
390
390
 
391
391
  /// Returns a set of all children of type (CHA). Also gradually builds chaMap.
392
392
  const NodeBS &cha(const DIType *type, bool firstField);
@@ -116,6 +116,23 @@ public:
116
116
  return svfModule->getSVFFunction(fun);
117
117
  }
118
118
 
119
+ /// Get the corresponding Function based on its name
120
+ inline const SVFFunction *getSVFFunction(std::string name)
121
+ {
122
+ Function *fun = nullptr;
123
+
124
+ for (u32_t i = 0; i < llvmModuleSet->getModuleNum(); ++i)
125
+ {
126
+ Module *mod = llvmModuleSet->getModule(i);
127
+ fun = mod->getFunction(name);
128
+ if (fun)
129
+ {
130
+ return llvmModuleSet->getSVFFunction(fun);
131
+ }
132
+ }
133
+ return nullptr;
134
+ }
135
+
119
136
  /// Fun decl --> def
120
137
  bool hasDefinition(const Function *fun) const
121
138
  {
@@ -74,7 +74,6 @@ typedef llvm::Instruction Instruction;
74
74
  typedef llvm::CallBase CallBase;
75
75
  typedef llvm::GlobalValue GlobalValue;
76
76
  typedef llvm::GlobalVariable GlobalVariable;
77
- typedef llvm::Module Module;
78
77
  typedef llvm::User User;
79
78
  typedef llvm::Loop Loop;
80
79
  typedef llvm::LoopInfo LoopInfo;
@@ -216,7 +216,7 @@ public:
216
216
  return operandStr;
217
217
  }
218
218
 
219
- std::vector<NodeID> getOperands()
219
+ std::vector<NodeID> &getOperands()
220
220
  {
221
221
  return operands;
222
222
  }
@@ -247,7 +247,7 @@ public:
247
247
  // return value = -3 is an object node
248
248
  // return value = -4 is an offset
249
249
  // return value = -5 is an illegal operand format
250
- int getNodeIDType(std::string s);
250
+ s32_t getNodeIDType(std::string s);
251
251
 
252
252
  // Get the corresponding name in ext_t, e.g. "EXT_ADDR" in {"addr", EXT_ADDR},
253
253
  std::string get_opName(const std::string& s);
@@ -3868,7 +3868,7 @@
3868
3868
  "stpcpy": {
3869
3869
  "type": "EFT_L_A0__A1_A0",
3870
3870
  "overwrite_app_function": 0,
3871
- "memcpy_like": ["0", "1", "2"],
3871
+ "memcpy_like": ["0", "1"],
3872
3872
  "CopyStmt": {
3873
3873
  "src": "Arg0",
3874
3874
  "dst": "Ret"
@@ -3877,7 +3877,7 @@
3877
3877
  "strcat": {
3878
3878
  "type": "EFT_L_A0__A1_A0",
3879
3879
  "overwrite_app_function": 0,
3880
- "memcpy_like": ["0", "1", "2"],
3880
+ "memcpy_like": ["0", "1"],
3881
3881
  "CopyStmt": {
3882
3882
  "src": "Arg0",
3883
3883
  "dst": "Ret"
@@ -3886,7 +3886,7 @@
3886
3886
  "strcpy": {
3887
3887
  "type": "EFT_L_A0__A1_A0",
3888
3888
  "overwrite_app_function": 0,
3889
- "memcpy_like": ["0", "1", "2"],
3889
+ "memcpy_like": ["0", "1"],
3890
3890
  "CopyStmt": {
3891
3891
  "src": "Arg0",
3892
3892
  "dst": "Ret"
@@ -224,19 +224,7 @@ inline CallSite getLLVMCallSite(const Instruction* inst)
224
224
  /// Get the corresponding Function based on its name
225
225
  inline const SVFFunction* getFunction(std::string name)
226
226
  {
227
- Function* fun = nullptr;
228
- LLVMModuleSet* llvmModuleset = LLVMModuleSet::getLLVMModuleSet();
229
-
230
- for (u32_t i = 0; i < llvmModuleset->getModuleNum(); ++i)
231
- {
232
- Module *mod = llvmModuleset->getModule(i);
233
- fun = mod->getFunction(name);
234
- if(fun)
235
- {
236
- return llvmModuleset->getSVFFunction(fun);
237
- }
238
- }
239
- return nullptr;
227
+ return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(name);
240
228
  }
241
229
 
242
230
  /// Split into two substrings around the first occurrence of a separator string.
@@ -99,9 +99,6 @@ public:
99
99
  /// Run pointer analysis on SVFModule
100
100
  virtual void runOnModule(SVFModule* svfModule);
101
101
 
102
- /// Run pointer analysis on LLVM module
103
- virtual bool runOnModule(Module& module);
104
-
105
102
  /// PTA name
106
103
  virtual inline std::string getPassName() const
107
104
  {
Binary file
@@ -43,9 +43,6 @@ public:
43
43
  /// We start from here
44
44
  virtual void runOnModule(SVFModule* module);
45
45
 
46
- /// We start from here
47
- virtual bool runOnModule(Module& module);
48
-
49
46
  /// Select a client
50
47
  virtual void selectClient(SVFModule* module);
51
48
 
@@ -38,6 +38,7 @@ typedef llvm::UnifyFunctionExitNodesLegacyPass UnifyFunctionExitNodes;
38
38
  typedef llvm::UnifyFunctionExitNodes UnifyFunctionExitNodes;
39
39
  #endif
40
40
 
41
+ typedef llvm::Module Module;
41
42
 
42
43
  typedef llvm::SMDiagnostic SMDiagnostic;
43
44
 
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  #include "Graphs/CHG.h"
31
+ #include "SVF-FE/BasicTypes.h"
31
32
 
32
33
  namespace SVF
33
34
  {
@@ -386,7 +386,7 @@ private:
386
386
  void handleDISubroutineType(const DISubroutineType *subroutineType);
387
387
 
388
388
  /// Finds all defined virtual functions and attaches them to nodes.
389
- void buildVTables(const Module &module);
389
+ void buildVTables(const SVFModule &module);
390
390
 
391
391
  /// Returns a set of all children of type (CHA). Also gradually builds chaMap.
392
392
  const NodeBS &cha(const DIType *type, bool firstField);
@@ -116,6 +116,23 @@ public:
116
116
  return svfModule->getSVFFunction(fun);
117
117
  }
118
118
 
119
+ /// Get the corresponding Function based on its name
120
+ inline const SVFFunction *getSVFFunction(std::string name)
121
+ {
122
+ Function *fun = nullptr;
123
+
124
+ for (u32_t i = 0; i < llvmModuleSet->getModuleNum(); ++i)
125
+ {
126
+ Module *mod = llvmModuleSet->getModule(i);
127
+ fun = mod->getFunction(name);
128
+ if (fun)
129
+ {
130
+ return llvmModuleSet->getSVFFunction(fun);
131
+ }
132
+ }
133
+ return nullptr;
134
+ }
135
+
119
136
  /// Fun decl --> def
120
137
  bool hasDefinition(const Function *fun) const
121
138
  {
@@ -74,7 +74,6 @@ typedef llvm::Instruction Instruction;
74
74
  typedef llvm::CallBase CallBase;
75
75
  typedef llvm::GlobalValue GlobalValue;
76
76
  typedef llvm::GlobalVariable GlobalVariable;
77
- typedef llvm::Module Module;
78
77
  typedef llvm::User User;
79
78
  typedef llvm::Loop Loop;
80
79
  typedef llvm::LoopInfo LoopInfo;
@@ -224,19 +224,7 @@ inline CallSite getLLVMCallSite(const Instruction* inst)
224
224
  /// Get the corresponding Function based on its name
225
225
  inline const SVFFunction* getFunction(std::string name)
226
226
  {
227
- Function* fun = nullptr;
228
- LLVMModuleSet* llvmModuleset = LLVMModuleSet::getLLVMModuleSet();
229
-
230
- for (u32_t i = 0; i < llvmModuleset->getModuleNum(); ++i)
231
- {
232
- Module *mod = llvmModuleset->getModule(i);
233
- fun = mod->getFunction(name);
234
- if(fun)
235
- {
236
- return llvmModuleset->getSVFFunction(fun);
237
- }
238
- }
239
- return nullptr;
227
+ return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(name);
240
228
  }
241
229
 
242
230
  /// Split into two substrings around the first occurrence of a separator string.
@@ -99,9 +99,6 @@ public:
99
99
  /// Run pointer analysis on SVFModule
100
100
  virtual void runOnModule(SVFModule* svfModule);
101
101
 
102
- /// Run pointer analysis on LLVM module
103
- virtual bool runOnModule(Module& module);
104
-
105
102
  /// PTA name
106
103
  virtual inline std::string getPassName() const
107
104
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1204",
3
+ "version": "1.0.1207",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {