svf-lib 1.0.1257 → 1.0.1258

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.
@@ -188,6 +188,9 @@ typedef llvm::SCEVConstant SCEVConstant;
188
188
  typedef llvm::ScalarEvolution ScalarEvolution;
189
189
  typedef llvm::SCEV SCEV;
190
190
 
191
+ /// LLVM outputs
192
+ typedef llvm::raw_fd_ostream raw_fd_ostream;
193
+
191
194
  // LLVM Types.
192
195
  typedef llvm::VectorType VectorType;
193
196
  #if (LLVM_VERSION_MAJOR >= 9)
@@ -76,7 +76,6 @@ typedef llvm::GlobalVariable GlobalVariable;
76
76
 
77
77
  /// LLVM outputs
78
78
  typedef llvm::raw_string_ostream raw_string_ostream;
79
- typedef llvm::raw_fd_ostream raw_fd_ostream;
80
79
 
81
80
  /// LLVM types
82
81
  typedef llvm::StructType StructType;
@@ -214,17 +213,7 @@ public:
214
213
  return bb2LoopMap.find(bb)!=bb2LoopMap.end();
215
214
  }
216
215
 
217
- inline const std::vector<const BasicBlock*>& getLoopInfo(const BasicBlock* bb) const
218
- {
219
- Map<const BasicBlock*, std::vector<const BasicBlock*>>::const_iterator mapIter = bb2LoopMap.find(bb);
220
- if(mapIter != bb2LoopMap.end())
221
- return mapIter->second;
222
- else
223
- {
224
- assert(hasLoopInfo(bb) && "loopinfo does not exit(bb not in a loop)");
225
- abort();
226
- }
227
- }
216
+ const std::vector<const BasicBlock*>& getLoopInfo(const BasicBlock* bb) const;
228
217
 
229
218
  inline void addToBB2LoopMap(const BasicBlock* bb, const BasicBlock* loopBB)
230
219
  {
@@ -266,95 +255,13 @@ public:
266
255
  return this->exitBB;
267
256
  }
268
257
 
269
- void getExitBlocksOfLoop(const BasicBlock* bb, Set<const BasicBlock*>& exitbbs) const
270
- {
271
- if (hasLoopInfo(bb))
272
- {
273
- const std::vector<const BasicBlock*>& blocks = getLoopInfo(bb);
274
- assert(!blocks.empty() && "no available loop info?");
275
- for (const BasicBlock* block : blocks)
276
- {
277
- for (succ_const_iterator succIt = succ_begin(block); succIt != succ_end(block); succIt++)
278
- {
279
- const BasicBlock* succ = *succIt;
280
- if ((std::find(blocks.begin(), blocks.end(), succ)==blocks.end()))
281
- exitbbs.insert(succ);
282
- }
283
- }
284
- }
285
- }
286
-
287
- bool isLoopHeader(const BasicBlock* bb) const
288
- {
289
- if (hasLoopInfo(bb))
290
- {
291
- const std::vector<const BasicBlock*>& blocks = getLoopInfo(bb);
292
- assert(!blocks.empty() && "no available loop info?");
293
- return blocks.front() == bb;
294
- }
295
- return false;
296
- }
297
-
298
- bool dominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
299
- {
300
- if (bbKey == bbValue)
301
- return true;
302
-
303
- // An unreachable node is dominated by anything.
304
- if (isUnreachable(bbValue))
305
- {
306
- return true;
307
- }
308
-
309
- // And dominates nothing.
310
- if (isUnreachable(bbKey))
311
- {
312
- return false;
313
- }
314
-
315
- const Map<const BasicBlock*,Set<const BasicBlock*>>& dtBBsMap = getDomTreeMap();
316
- Map<const BasicBlock*,Set<const BasicBlock*>>::const_iterator mapIter = dtBBsMap.find(bbKey);
317
- if (mapIter != dtBBsMap.end())
318
- {
319
- const Set<const BasicBlock*> & dtBBs = mapIter->second;
320
- if (dtBBs.find(bbValue) != dtBBs.end())
321
- {
322
- return true;
323
- }
324
- }
325
-
326
- return false;
327
- }
328
-
329
- bool postDominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
330
- {
331
- if (bbKey == bbValue)
332
- return true;
333
-
334
- // An unreachable node is dominated by anything.
335
- if (isUnreachable(bbValue))
336
- {
337
- return true;
338
- }
339
-
340
- // And dominates nothing.
341
- if (isUnreachable(bbKey))
342
- {
343
- return false;
344
- }
345
-
346
- const Map<const BasicBlock*,Set<const BasicBlock*>>& dtBBsMap = getPostDomTreeMap();
347
- Map<const BasicBlock*,Set<const BasicBlock*>>::const_iterator mapIter = dtBBsMap.find(bbKey);
348
- if (mapIter != dtBBsMap.end())
349
- {
350
- const Set<const BasicBlock*> & dtBBs = mapIter->second;
351
- if (dtBBs.find(bbValue) != dtBBs.end())
352
- {
353
- return true;
354
- }
355
- }
356
- return false;
357
- }
258
+ void getExitBlocksOfLoop(const BasicBlock* bb, Set<const BasicBlock*>& exitbbs) const;
259
+
260
+ bool isLoopHeader(const BasicBlock* bb) const;
261
+
262
+ bool dominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const;
263
+
264
+ bool postDominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const;
358
265
 
359
266
  // Dump Control Flow Graph of llvm function, with instructions
360
267
  void viewCFG();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1257",
3
+ "version": "1.0.1258",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {