svf-lib 1.0.1268 → 1.0.1269

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.
@@ -209,6 +209,11 @@ public:
209
209
  {
210
210
  return globalBlockNode;
211
211
  }
212
+ inline void addGlobalICFGNode()
213
+ {
214
+ globalBlockNode = new GlobalICFGNode(totalICFGNode++);
215
+ addICFGNode(globalBlockNode);
216
+ }
212
217
  //@}
213
218
 
214
219
  private:
@@ -92,7 +92,7 @@ private:
92
92
  OrderedNodeSet candidatePointers;
93
93
  ICFG* icfg; // ICFG
94
94
  CallSiteSet callSiteSet; /// all the callsites of a program
95
-
95
+ SVFModule* svfModule; /// SVF Module
96
96
  /// Constructor
97
97
  SVFIR(bool buildFromFile);
98
98
 
@@ -128,9 +128,14 @@ public:
128
128
  {
129
129
  return GepObjVarMap;
130
130
  }
131
- /// Return ICFG
131
+ /// Set/Get ICFG
132
+ inline void setICFG(ICFG* i)
133
+ {
134
+ icfg = i;
135
+ }
132
136
  inline ICFG* getICFG()
133
137
  {
138
+ assert(icfg->totalICFGNode>0 && "empty ICFG! Build SVF IR first!");
134
139
  return icfg;
135
140
  }
136
141
  /// Return valid pointers
@@ -151,10 +156,15 @@ public:
151
156
  /// Whether to handle blackhole edge
152
157
  static void handleBlackHole(bool b);
153
158
  //@}
154
- /// Get LLVM Module
159
+ /// Set/Get LLVM Module
160
+ inline void setModule(SVFModule* mod)
161
+ {
162
+ svfModule = mod;
163
+ }
155
164
  inline SVFModule* getModule()
156
165
  {
157
- return SymbolTableInfo::SymbolInfo()->getModule();
166
+ assert(svfModule && "empty SVFModule! Build SVF IR first!");
167
+ return svfModule;
158
168
  }
159
169
  /// Get/set methods to get SVFStmts based on their kinds and ICFGNodes
160
170
  //@{
@@ -47,13 +47,13 @@ class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
47
47
 
48
48
  private:
49
49
  SVFIR* pag;
50
- SVFModule* svfMod;
50
+ SVFModule* svfModule;
51
51
  const BasicBlock* curBB; ///< Current basic block during SVFIR construction when visiting the module
52
52
  const Value* curVal; ///< Current Value during SVFIR construction when visiting the module
53
53
 
54
54
  public:
55
55
  /// Constructor
56
- SVFIRBuilder(): pag(SVFIR::getPAG()), svfMod(nullptr), curBB(nullptr),curVal(nullptr)
56
+ SVFIRBuilder(SVFModule* mod): pag(SVFIR::getPAG()), svfModule(mod), curBB(nullptr),curVal(nullptr)
57
57
  {
58
58
  }
59
59
  /// Destructor
@@ -62,7 +62,7 @@ public:
62
62
  }
63
63
 
64
64
  /// Start building SVFIR here
65
- virtual SVFIR* build(SVFModule* svfModule);
65
+ virtual SVFIR* build();
66
66
 
67
67
  /// Return SVFIR
68
68
  SVFIR* getPAG() const
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1268",
3
+ "version": "1.0.1269",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {