svf-lib 1.0.1205 → 1.0.1206

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;
@@ -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.1205",
3
+ "version": "1.0.1206",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {