svf-lib 1.0.1012 → 1.0.1015

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.
@@ -50,7 +50,7 @@ public:
50
50
  virtual void selectClient(SVFModule* module);
51
51
 
52
52
  /// Pass name
53
- virtual inline StringRef getPassName() const
53
+ virtual inline std::string getPassName() const
54
54
  {
55
55
  return "DDAPass";
56
56
  }
@@ -71,7 +71,7 @@ private:
71
71
  if (callee)
72
72
  {
73
73
  if (ExtAPI::EFT_L_A0__A0R_A1R == ExtAPI::getExtAPI()->get_type(callee)
74
- || callee->getName().find("llvm.memset") != StringRef::npos)
74
+ || callee->getName().find("llvm.memset") != std::string::npos)
75
75
  return I;
76
76
  }
77
77
  I = I->getPrevNode();
@@ -62,7 +62,7 @@ public:
62
62
  virtual void detect(SVFModule* module);
63
63
 
64
64
  /// Pass name
65
- virtual StringRef getPassName() const
65
+ virtual llvm::StringRef getPassName() const
66
66
  {
67
67
  return "Multi threaded program analysis pass";
68
68
  }
@@ -71,7 +71,7 @@ public:
71
71
  inline bool isMemset(const Instruction *I)
72
72
  {
73
73
  const Function* F =SVFUtil::getCallee(I)->getLLVMFun();
74
- return F && F->getName().find("llvm.memset") != StringRef::npos;
74
+ return F && F->getName().find("llvm.memset") != std::string::npos;
75
75
  }
76
76
 
77
77
  /// Check if Function "F" is memcpy
@@ -417,7 +417,7 @@ private:
417
417
  if (const SVFFunction *callee = SVFUtil::getCallee(I))
418
418
  {
419
419
  if (ExtAPI::EFT_L_A0__A0R_A1R == ExtAPI::getExtAPI()->get_type(callee)
420
- || callee->getName().find("llvm.memset") != StringRef::npos)
420
+ || callee->getName().find("llvm.memset") != std::string::npos)
421
421
  return I;
422
422
  }
423
423
  I = I->getPrevNode();
@@ -37,7 +37,7 @@ private:
37
37
  public:
38
38
  static char ID;
39
39
  BreakConstantGEPs() : ModulePass(ID) {}
40
- StringRef getPassName() const
40
+ llvm::StringRef getPassName() const
41
41
  {
42
42
  return "Remove Constant GEP Expressions";
43
43
  }
@@ -61,7 +61,7 @@ private:
61
61
  public:
62
62
  static char ID;
63
63
  MergeFunctionRets() : ModulePass(ID) {}
64
- StringRef getPassName() const
64
+ llvm::StringRef getPassName() const
65
65
  {
66
66
  return "unify function exit into one dummy exit basic block";
67
67
  }
@@ -79,7 +79,6 @@ typedef llvm::LoopInfo LoopInfo;
79
79
  /// LLVM outputs
80
80
  typedef llvm::raw_string_ostream raw_string_ostream;
81
81
  typedef llvm::raw_fd_ostream raw_fd_ostream;
82
- typedef llvm::StringRef StringRef;
83
82
 
84
83
  /// LLVM types
85
84
  typedef llvm::StructType StructType;
@@ -92,8 +91,8 @@ typedef llvm::DataLayout DataLayout;
92
91
 
93
92
  /// LLVM Aliases and constants
94
93
  typedef llvm::Argument Argument;
95
- typedef llvm::Constant Constant;
96
94
  typedef llvm::ConstantData ConstantData;
95
+ typedef llvm::Constant Constant;
97
96
  typedef llvm::ConstantInt ConstantInt;
98
97
  typedef llvm::ConstantPointerNull ConstantPointerNull;
99
98
  typedef llvm::ConstantArray ConstantArray;
@@ -143,7 +142,7 @@ public:
143
142
  {
144
143
  }
145
144
 
146
- SVFFunction(Function* f): SVFValue(f->getName(),SVFValue::SVFFunc),
145
+ SVFFunction(Function* f): SVFValue(f->getName().str(),SVFValue::SVFFunc),
147
146
  isDecl(f->isDeclaration()), isIntri(f->isIntrinsic()), fun(f)
148
147
  {
149
148
  }
@@ -220,7 +220,7 @@ private:
220
220
  GNodeK kind; ///< Type of this SVFValue
221
221
  public:
222
222
  /// Constructor
223
- SVFValue(const llvm::StringRef& val, SVFValKind k): value(val), kind(k)
223
+ SVFValue(const std::string& val, SVFValKind k): value(val), kind(k)
224
224
  {
225
225
  }
226
226
 
@@ -222,7 +222,7 @@ inline CallSite getLLVMCallSite(const Instruction* inst)
222
222
  }
223
223
 
224
224
  /// Get the corresponding Function based on its name
225
- inline const SVFFunction* getFunction(StringRef name)
225
+ inline const SVFFunction* getFunction(std::string name)
226
226
  {
227
227
  Function* fun = nullptr;
228
228
  LLVMModuleSet* llvmModuleset = LLVMModuleSet::getLLVMModuleSet();
@@ -239,6 +239,21 @@ inline const SVFFunction* getFunction(StringRef name)
239
239
  return nullptr;
240
240
  }
241
241
 
242
+ /// Split into two substrings around the first occurrence of a separator string.
243
+ inline std::vector<std::string> split(const std::string& s, char seperator)
244
+ {
245
+ std::vector<std::string> output;
246
+ std::string::size_type prev_pos = 0, pos = 0;
247
+ while((pos = s.find(seperator, pos)) != std::string::npos)
248
+ {
249
+ std::string substring( s.substr(prev_pos, pos-prev_pos) );
250
+ output.push_back(substring);
251
+ prev_pos = ++pos;
252
+ }
253
+ output.push_back(s.substr(prev_pos, pos-prev_pos));
254
+ return output;
255
+ }
256
+
242
257
  /// find the unique defined global across multiple modules
243
258
  inline const Value* getGlobalRep(const Value* val)
244
259
  {
@@ -103,7 +103,7 @@ public:
103
103
  virtual bool runOnModule(Module& module);
104
104
 
105
105
  /// PTA name
106
- virtual inline StringRef getPassName() const
106
+ virtual inline std::string getPassName() const
107
107
  {
108
108
  return "WPAPass";
109
109
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1012",
3
+ "version": "1.0.1015",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {