svf-lib 1.0.2232 → 1.0.2234

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.
@@ -57,7 +57,7 @@ public:
57
57
  typedef Map<const Function*, SVFFunction*> LLVMFun2SVFFunMap;
58
58
  typedef Map<const Function*, FunObjVar*> LLVMFun2FunObjVarMap;
59
59
  typedef Map<const BasicBlock*, SVFBasicBlock*> LLVMBB2SVFBBMap;
60
- typedef Map<const Instruction*, SVFInstruction*> LLVMInst2SVFInstMap;
60
+ typedef Map<const Instruction*, SVFLLVMValue*> LLVMInst2SVFInstMap;
61
61
  typedef Map<const Argument*, SVFLLVMValue*> LLVMArgument2SVFArgumentMap;
62
62
  typedef Map<const Constant*, SVFLLVMValue*> LLVMConst2SVFConstMap;
63
63
  typedef Map<const Value*, SVFLLVMValue*> LLVMValue2SVFOtherValueMap;
@@ -233,7 +233,7 @@ public:
233
233
  SVFBaseNode2LLVMValue[svfBB] = bb;
234
234
  }
235
235
 
236
- inline void addInstructionMap(const Instruction* inst, SVFInstruction* svfInst)
236
+ inline void addInstructionMap(const Instruction* inst, SVFLLVMValue* svfInst)
237
237
  {
238
238
  LLVMInst2SVFInst[inst] = svfInst;
239
239
  setValueAttr(inst,svfInst);
@@ -346,7 +346,7 @@ public:
346
346
  return it->second;
347
347
  }
348
348
 
349
- inline SVFInstruction* getSVFInstruction(const Instruction* inst) const
349
+ inline SVFLLVMValue* getSVFInstruction(const Instruction* inst) const
350
350
  {
351
351
  LLVMInst2SVFInstMap::const_iterator it = LLVMInst2SVFInst.find(inst);
352
352
  assert(it!=LLVMInst2SVFInst.end() && "SVF Instruction not found!");
@@ -454,9 +454,9 @@ protected:
454
454
  inline void addStoreEdge(NodeID src, NodeID dst)
455
455
  {
456
456
  ICFGNode* node;
457
- if (const SVFInstruction* inst = SVFUtil::dyn_cast<SVFInstruction>(curVal))
457
+ if (const Instruction* inst = SVFUtil::dyn_cast<Instruction>(llvmModuleSet()->getLLVMValue(curVal)))
458
458
  node = llvmModuleSet()->getICFGNode(
459
- SVFUtil::cast<Instruction>(llvmModuleSet()->getLLVMValue(inst)));
459
+ SVFUtil::cast<Instruction>(inst));
460
460
  else
461
461
  node = nullptr;
462
462
  if (StoreStmt* edge = pag->addStoreStmt(src, dst, node))
@@ -63,7 +63,6 @@ public:
63
63
  {
64
64
  SVFVal,
65
65
  SVFFunc,
66
- SVFInst,
67
66
  };
68
67
 
69
68
  private:
@@ -375,47 +374,6 @@ public:
375
374
  }
376
375
  };
377
376
 
378
- class ICFGNode;
379
- class FunObjVar;
380
-
381
- class SVFInstruction : public SVFLLVMValue
382
- {
383
- friend class SVFIRWriter;
384
- friend class SVFIRReader;
385
-
386
- private:
387
- const SVFBasicBlock* bb; /// The BasicBlock where this Instruction resides
388
- bool terminator; /// return true if this is a terminator instruction
389
- bool ret; /// return true if this is an return instruction of a function
390
-
391
- public:
392
- /// Constructor without name, set name with setName()
393
- SVFInstruction(const SVFType* ty, const SVFBasicBlock* b, bool tm,
394
- bool isRet, SVFValKind k = SVFInst);
395
- SVFInstruction(void) = delete;
396
-
397
- static inline bool classof(const SVFLLVMValue *node)
398
- {
399
- return node->getKind() == SVFInst;
400
- }
401
-
402
- inline const SVFBasicBlock* getParent() const
403
- {
404
- return bb;
405
- }
406
-
407
- inline const FunObjVar* getFunction() const
408
- {
409
- return bb->getParent();
410
- }
411
-
412
- inline bool isRetInst() const
413
- {
414
- return ret;
415
- }
416
- };
417
-
418
-
419
377
  /// [FOR DEBUG ONLY, DON'T USE IT UNSIDE `svf`!]
420
378
  /// Converts an SVFValue to corresponding LLVM::Value, then get the string
421
379
  /// representation of it. Use it only when you are debugging. Don't use
@@ -57,7 +57,7 @@ public:
57
57
  typedef Map<const Function*, SVFFunction*> LLVMFun2SVFFunMap;
58
58
  typedef Map<const Function*, FunObjVar*> LLVMFun2FunObjVarMap;
59
59
  typedef Map<const BasicBlock*, SVFBasicBlock*> LLVMBB2SVFBBMap;
60
- typedef Map<const Instruction*, SVFInstruction*> LLVMInst2SVFInstMap;
60
+ typedef Map<const Instruction*, SVFLLVMValue*> LLVMInst2SVFInstMap;
61
61
  typedef Map<const Argument*, SVFLLVMValue*> LLVMArgument2SVFArgumentMap;
62
62
  typedef Map<const Constant*, SVFLLVMValue*> LLVMConst2SVFConstMap;
63
63
  typedef Map<const Value*, SVFLLVMValue*> LLVMValue2SVFOtherValueMap;
@@ -233,7 +233,7 @@ public:
233
233
  SVFBaseNode2LLVMValue[svfBB] = bb;
234
234
  }
235
235
 
236
- inline void addInstructionMap(const Instruction* inst, SVFInstruction* svfInst)
236
+ inline void addInstructionMap(const Instruction* inst, SVFLLVMValue* svfInst)
237
237
  {
238
238
  LLVMInst2SVFInst[inst] = svfInst;
239
239
  setValueAttr(inst,svfInst);
@@ -346,7 +346,7 @@ public:
346
346
  return it->second;
347
347
  }
348
348
 
349
- inline SVFInstruction* getSVFInstruction(const Instruction* inst) const
349
+ inline SVFLLVMValue* getSVFInstruction(const Instruction* inst) const
350
350
  {
351
351
  LLVMInst2SVFInstMap::const_iterator it = LLVMInst2SVFInst.find(inst);
352
352
  assert(it!=LLVMInst2SVFInst.end() && "SVF Instruction not found!");
@@ -454,9 +454,9 @@ protected:
454
454
  inline void addStoreEdge(NodeID src, NodeID dst)
455
455
  {
456
456
  ICFGNode* node;
457
- if (const SVFInstruction* inst = SVFUtil::dyn_cast<SVFInstruction>(curVal))
457
+ if (const Instruction* inst = SVFUtil::dyn_cast<Instruction>(llvmModuleSet()->getLLVMValue(curVal)))
458
458
  node = llvmModuleSet()->getICFGNode(
459
- SVFUtil::cast<Instruction>(llvmModuleSet()->getLLVMValue(inst)));
459
+ SVFUtil::cast<Instruction>(inst));
460
460
  else
461
461
  node = nullptr;
462
462
  if (StoreStmt* edge = pag->addStoreStmt(src, dst, node))
@@ -63,7 +63,6 @@ public:
63
63
  {
64
64
  SVFVal,
65
65
  SVFFunc,
66
- SVFInst,
67
66
  };
68
67
 
69
68
  private:
@@ -375,47 +374,6 @@ public:
375
374
  }
376
375
  };
377
376
 
378
- class ICFGNode;
379
- class FunObjVar;
380
-
381
- class SVFInstruction : public SVFLLVMValue
382
- {
383
- friend class SVFIRWriter;
384
- friend class SVFIRReader;
385
-
386
- private:
387
- const SVFBasicBlock* bb; /// The BasicBlock where this Instruction resides
388
- bool terminator; /// return true if this is a terminator instruction
389
- bool ret; /// return true if this is an return instruction of a function
390
-
391
- public:
392
- /// Constructor without name, set name with setName()
393
- SVFInstruction(const SVFType* ty, const SVFBasicBlock* b, bool tm,
394
- bool isRet, SVFValKind k = SVFInst);
395
- SVFInstruction(void) = delete;
396
-
397
- static inline bool classof(const SVFLLVMValue *node)
398
- {
399
- return node->getKind() == SVFInst;
400
- }
401
-
402
- inline const SVFBasicBlock* getParent() const
403
- {
404
- return bb;
405
- }
406
-
407
- inline const FunObjVar* getFunction() const
408
- {
409
- return bb->getParent();
410
- }
411
-
412
- inline bool isRetInst() const
413
- {
414
- return ret;
415
- }
416
- };
417
-
418
-
419
377
  /// [FOR DEBUG ONLY, DON'T USE IT UNSIDE `svf`!]
420
378
  /// Converts an SVFValue to corresponding LLVM::Value, then get the string
421
379
  /// representation of it. Use it only when you are debugging. Don't use
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2232",
3
+ "version": "1.0.2234",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {