svf-lib 1.0.1277 → 1.0.1279

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.
Files changed (95) hide show
  1. package/SVF-linux/Release-build/lib/libSvf.a +0 -0
  2. package/SVF-linux/include/DDA/DDAVFSolver.h +1 -2
  3. package/SVF-linux/include/Graphs/ICFG.h +16 -16
  4. package/SVF-linux/include/Graphs/ICFGEdge.h +6 -6
  5. package/SVF-linux/include/Graphs/ICFGNode.h +16 -16
  6. package/SVF-linux/include/Graphs/IRGraph.h +6 -6
  7. package/SVF-linux/include/Graphs/ThreadCallGraph.h +2 -2
  8. package/SVF-linux/include/Graphs/VFGNode.h +1 -1
  9. package/SVF-linux/include/MSSA/MSSAMuChi.h +11 -11
  10. package/SVF-linux/include/MSSA/MemRegion.h +2 -2
  11. package/SVF-linux/include/MSSA/MemSSA.h +13 -13
  12. package/SVF-linux/include/MTA/FSMPTA.h +1 -1
  13. package/SVF-linux/include/MTA/LockAnalysis.h +33 -33
  14. package/SVF-linux/include/MTA/LockResultValidator.h +7 -6
  15. package/SVF-linux/include/MTA/MHP.h +46 -46
  16. package/SVF-linux/include/MTA/MTA.h +4 -4
  17. package/SVF-linux/include/MTA/MTAAnnotator.h +6 -4
  18. package/SVF-linux/include/MTA/MTAResultValidator.h +51 -44
  19. package/SVF-linux/include/MTA/PCG.h +22 -27
  20. package/SVF-linux/include/MTA/TCT.h +28 -37
  21. package/SVF-linux/include/MemoryModel/SVFStatements.h +11 -6
  22. package/SVF-linux/include/MemoryModel/SVFVariables.h +4 -4
  23. package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +13 -19
  24. package/SVF-linux/include/SABER/ProgSlice.h +5 -5
  25. package/SVF-linux/include/SABER/SaberCheckerAPI.h +4 -4
  26. package/SVF-linux/include/SABER/SaberCondAllocator.h +32 -35
  27. package/SVF-linux/include/SVF-FE/BasicTypes.h +10 -0
  28. package/SVF-linux/include/SVF-FE/CPPUtil.h +9 -8
  29. package/SVF-linux/include/SVF-FE/DCHG.h +4 -4
  30. package/SVF-linux/include/SVF-FE/DataFlowUtil.h +1 -1
  31. package/SVF-linux/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
  32. package/SVF-linux/include/SVF-FE/ICFGBuilder.h +9 -9
  33. package/SVF-linux/include/SVF-FE/IRAnnotator.h +9 -9
  34. package/SVF-linux/include/SVF-FE/LLVMModule.h +119 -22
  35. package/SVF-linux/include/SVF-FE/LLVMUtil.h +31 -52
  36. package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +14 -20
  37. package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +8 -8
  38. package/SVF-linux/include/Util/Annotator.h +22 -22
  39. package/SVF-linux/include/Util/BasicTypes.h +476 -72
  40. package/SVF-linux/include/Util/Casting.h +1 -1
  41. package/SVF-linux/include/Util/CxtStmt.h +13 -12
  42. package/SVF-linux/include/Util/SVFBasicTypes.h +0 -78
  43. package/SVF-linux/include/Util/SVFInstruction.h +40 -0
  44. package/SVF-linux/include/Util/SVFModule.h +58 -124
  45. package/SVF-linux/include/Util/SVFUtil.h +48 -39
  46. package/SVF-linux/include/Util/ThreadAPI.h +17 -28
  47. package/SVF-linux/include/WPA/WPAPass.h +4 -4
  48. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  49. package/SVF-osx/include/DDA/DDAVFSolver.h +1 -2
  50. package/SVF-osx/include/Graphs/ICFG.h +16 -16
  51. package/SVF-osx/include/Graphs/ICFGEdge.h +6 -6
  52. package/SVF-osx/include/Graphs/ICFGNode.h +16 -16
  53. package/SVF-osx/include/Graphs/IRGraph.h +6 -6
  54. package/SVF-osx/include/Graphs/ThreadCallGraph.h +2 -2
  55. package/SVF-osx/include/Graphs/VFGNode.h +1 -1
  56. package/SVF-osx/include/MSSA/MSSAMuChi.h +11 -11
  57. package/SVF-osx/include/MSSA/MemRegion.h +2 -2
  58. package/SVF-osx/include/MSSA/MemSSA.h +13 -13
  59. package/SVF-osx/include/MTA/FSMPTA.h +1 -1
  60. package/SVF-osx/include/MTA/LockAnalysis.h +33 -33
  61. package/SVF-osx/include/MTA/LockResultValidator.h +7 -6
  62. package/SVF-osx/include/MTA/MHP.h +46 -46
  63. package/SVF-osx/include/MTA/MTA.h +4 -4
  64. package/SVF-osx/include/MTA/MTAAnnotator.h +6 -4
  65. package/SVF-osx/include/MTA/MTAResultValidator.h +51 -44
  66. package/SVF-osx/include/MTA/PCG.h +22 -27
  67. package/SVF-osx/include/MTA/TCT.h +28 -37
  68. package/SVF-osx/include/MemoryModel/SVFStatements.h +11 -6
  69. package/SVF-osx/include/MemoryModel/SVFVariables.h +4 -4
  70. package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +13 -19
  71. package/SVF-osx/include/SABER/ProgSlice.h +5 -5
  72. package/SVF-osx/include/SABER/SaberCheckerAPI.h +4 -4
  73. package/SVF-osx/include/SABER/SaberCondAllocator.h +32 -35
  74. package/SVF-osx/include/SVF-FE/BasicTypes.h +10 -0
  75. package/SVF-osx/include/SVF-FE/CPPUtil.h +9 -8
  76. package/SVF-osx/include/SVF-FE/DCHG.h +4 -4
  77. package/SVF-osx/include/SVF-FE/DataFlowUtil.h +1 -1
  78. package/SVF-osx/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
  79. package/SVF-osx/include/SVF-FE/ICFGBuilder.h +9 -9
  80. package/SVF-osx/include/SVF-FE/IRAnnotator.h +9 -9
  81. package/SVF-osx/include/SVF-FE/LLVMModule.h +119 -22
  82. package/SVF-osx/include/SVF-FE/LLVMUtil.h +31 -52
  83. package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +14 -20
  84. package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +8 -8
  85. package/SVF-osx/include/Util/Annotator.h +22 -22
  86. package/SVF-osx/include/Util/BasicTypes.h +476 -72
  87. package/SVF-osx/include/Util/Casting.h +1 -1
  88. package/SVF-osx/include/Util/CxtStmt.h +13 -12
  89. package/SVF-osx/include/Util/SVFBasicTypes.h +0 -78
  90. package/SVF-osx/include/Util/SVFInstruction.h +40 -0
  91. package/SVF-osx/include/Util/SVFModule.h +58 -124
  92. package/SVF-osx/include/Util/SVFUtil.h +48 -39
  93. package/SVF-osx/include/Util/ThreadAPI.h +17 -28
  94. package/SVF-osx/include/WPA/WPAPass.h +4 -4
  95. package/package.json +1 -1
@@ -55,7 +55,7 @@ public:
55
55
  typedef Map<const SVFGNode*, Condition> SVFGNodeToCondMap; ///< map a SVFGNode to its condition during value-flow guard computation
56
56
 
57
57
  typedef FIFOWorkList<const SVFGNode*> VFWorkList; ///< worklist for value-flow guard computation
58
- typedef FIFOWorkList<const BasicBlock*> CFWorkList; ///< worklist for control-flow guard computation
58
+ typedef FIFOWorkList<const SVFBasicBlock*> CFWorkList; ///< worklist for control-flow guard computation
59
59
 
60
60
  /// Constructor
61
61
  ProgSlice(const SVFGNode* src, SaberCondAllocator* pa, const SVFG* graph):
@@ -246,15 +246,15 @@ protected:
246
246
 
247
247
  /// Compute guards for value-flows
248
248
  //@{
249
- inline Condition ComputeIntraVFGGuard(const BasicBlock* src, const BasicBlock* dst)
249
+ inline Condition ComputeIntraVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst)
250
250
  {
251
251
  return pathAllocator->ComputeIntraVFGGuard(src,dst);
252
252
  }
253
- inline Condition ComputeInterCallVFGGuard(const BasicBlock* src, const BasicBlock* dst, const BasicBlock* callBB)
253
+ inline Condition ComputeInterCallVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst, const SVFBasicBlock* callBB)
254
254
  {
255
255
  return pathAllocator->ComputeInterCallVFGGuard(src,dst,callBB);
256
256
  }
257
- inline Condition ComputeInterRetVFGGuard(const BasicBlock* src, const BasicBlock* dst, const BasicBlock* retBB)
257
+ inline Condition ComputeInterRetVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst, const SVFBasicBlock* retBB)
258
258
  {
259
259
  return pathAllocator->ComputeInterRetVFGGuard(src,dst,retBB);
260
260
  }
@@ -268,7 +268,7 @@ protected:
268
268
  /// Return the basic block where a SVFGNode resides in
269
269
  /// a SVFGNode may not in a basic block if it is not a program statement
270
270
  /// (e.g. PAGEdge is an global assignment or NullPtrSVFGNode)
271
- inline const BasicBlock* getSVFGNodeBB(const SVFGNode* node) const
271
+ inline const SVFBasicBlock* getSVFGNodeBB(const SVFGNode* node) const
272
272
  {
273
273
  const ICFGNode* icfgNode = node->getICFGNode();
274
274
  if(SVFUtil::isa<NullPtrSVFGNode>(node) == false)
@@ -101,7 +101,7 @@ public:
101
101
  {
102
102
  return getType(fun) == CK_ALLOC;
103
103
  }
104
- inline bool isMemAlloc(const Instruction *inst) const
104
+ inline bool isMemAlloc(const SVFInstruction* inst) const
105
105
  {
106
106
  return getType(SVFUtil::getCallee(inst)) == CK_ALLOC;
107
107
  }
@@ -117,7 +117,7 @@ public:
117
117
  {
118
118
  return getType(fun) == CK_FREE;
119
119
  }
120
- inline bool isMemDealloc(const Instruction *inst) const
120
+ inline bool isMemDealloc(const SVFInstruction *inst) const
121
121
  {
122
122
  return getType(SVFUtil::getCallee(inst)) == CK_FREE;
123
123
  }
@@ -133,7 +133,7 @@ public:
133
133
  {
134
134
  return getType(fun) == CK_FOPEN;
135
135
  }
136
- inline bool isFOpen(const Instruction *inst) const
136
+ inline bool isFOpen(const SVFInstruction* inst) const
137
137
  {
138
138
  return getType(SVFUtil::getCallee(inst)) == CK_FOPEN;
139
139
  }
@@ -149,7 +149,7 @@ public:
149
149
  {
150
150
  return getType(fun) == CK_FCLOSE;
151
151
  }
152
- inline bool isFClose(const Instruction *inst) const
152
+ inline bool isFClose(const SVFInstruction* inst) const
153
153
  {
154
154
  return getType(SVFUtil::getCallee(inst)) == CK_FCLOSE;
155
155
  }
@@ -50,13 +50,13 @@ class SaberCondAllocator
50
50
  public:
51
51
 
52
52
  typedef Z3Expr Condition; /// z3 condition
53
- typedef Map<u32_t, const Instruction *> IndexToTermInstMap; /// id to instruction map for z3
53
+ typedef Map<u32_t, const SVFInstruction *> IndexToTermInstMap; /// id to instruction map for z3
54
54
  typedef Map<u32_t,Condition> CondPosMap; ///< map a branch to its Condition
55
- typedef Map<const BasicBlock*, CondPosMap > BBCondMap; /// map bb to a Condition
56
- typedef Set<const BasicBlock*> BasicBlockSet;
57
- typedef Map<const Function*, BasicBlockSet> FunToExitBBsMap; ///< map a function to all its basic blocks calling program exit
58
- typedef Map<const BasicBlock*, Condition> BBToCondMap; ///< map a basic block to its condition during control-flow guard computation
59
- typedef FIFOWorkList<const BasicBlock*> CFWorkList; ///< worklist for control-flow guard computation
55
+ typedef Map<const SVFBasicBlock*, CondPosMap > BBCondMap; /// map bb to a Condition
56
+ typedef Set<const SVFBasicBlock*> BasicBlockSet;
57
+ typedef Map<const SVFFunction*, BasicBlockSet> FunToExitBBsMap; ///< map a function to all its basic blocks calling program exit
58
+ typedef Map<const SVFBasicBlock*, Condition> BBToCondMap; ///< map a basic block to its condition during control-flow guard computation
59
+ typedef FIFOWorkList<const SVFBasicBlock*> CFWorkList; ///< worklist for control-flow guard computation
60
60
 
61
61
 
62
62
  /// Constructor
@@ -118,21 +118,21 @@ public:
118
118
  }
119
119
 
120
120
  /// Allocate a new condition
121
- Condition newCond(const Instruction* inst);
121
+ Condition newCond(const SVFInstruction* inst);
122
122
 
123
123
  /// Perform path allocation
124
124
  void allocate(const SVFModule* module);
125
125
 
126
126
  /// Get/Set instruction based on Z3 expression id
127
127
  //{@
128
- inline const Instruction *getCondInst(u32_t id) const
128
+ inline const SVFInstruction* getCondInst(u32_t id) const
129
129
  {
130
130
  IndexToTermInstMap::const_iterator it = idToTermInstMap.find(id);
131
131
  assert(it != idToTermInstMap.end() && "this should be a fresh condition");
132
132
  return it->second;
133
133
  }
134
134
 
135
- inline void setCondInst(const Condition &condition, const Instruction *inst)
135
+ inline void setCondInst(const Condition &condition, const SVFInstruction* inst)
136
136
  {
137
137
  assert(idToTermInstMap.find(condition.id()) == idToTermInstMap.end() && "this should be a fresh condition");
138
138
  idToTermInstMap[condition.id()] = inst;
@@ -144,38 +144,35 @@ public:
144
144
  return negConds.test(id);
145
145
  }
146
146
 
147
- inline bool postDominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
147
+ inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
148
148
  {
149
- const SVFFunction* keyFunc = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(bbKey->getParent());
150
- const SVFFunction* valueFunc = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(bbValue->getParent());
149
+ const SVFFunction* keyFunc = bbKey->getParent();
150
+ const SVFFunction* valueFunc = bbValue->getParent();
151
151
  bool funcEq = (keyFunc == valueFunc);
152
152
  (void)funcEq; // Suppress warning of unused variable under release build
153
153
  assert(funcEq && "two basicblocks should be in the same function!");
154
-
155
154
  return keyFunc->postDominate(bbKey,bbValue);
156
155
  }
157
156
 
158
- inline bool dominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
157
+ inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
159
158
  {
160
- const SVFFunction* keyFunc = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(bbKey->getParent());
161
- const SVFFunction* valueFunc = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(bbValue->getParent());
159
+ const SVFFunction* keyFunc = bbKey->getParent();
160
+ const SVFFunction* valueFunc = bbValue->getParent();
162
161
  bool funcEq = (keyFunc == valueFunc);
163
162
  (void)funcEq; // Suppress warning of unused variable under release build
164
-
165
163
  assert(funcEq && "two basicblocks should be in the same function!");
166
-
167
164
  return keyFunc->dominate(bbKey,bbValue);
168
165
  }
169
166
 
170
167
  /// Guard Computation for a value-flow (between two basic blocks)
171
168
  //@{
172
- virtual Condition ComputeIntraVFGGuard(const BasicBlock* src, const BasicBlock* dst);
173
- virtual Condition ComputeInterCallVFGGuard(const BasicBlock* src, const BasicBlock* dst, const BasicBlock* callBB);
174
- virtual Condition ComputeInterRetVFGGuard(const BasicBlock* src, const BasicBlock* dst, const BasicBlock* retBB);
169
+ virtual Condition ComputeIntraVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst);
170
+ virtual Condition ComputeInterCallVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst, const SVFBasicBlock* callBB);
171
+ virtual Condition ComputeInterRetVFGGuard(const SVFBasicBlock* src, const SVFBasicBlock* dst, const SVFBasicBlock* retBB);
175
172
 
176
173
  /// Get complement condition (from B1 to B0) according to a complementBB (BB2) at a phi
177
174
  /// e.g., B0: dstBB; B1:incomingBB; B2:complementBB
178
- virtual Condition getPHIComplementCond(const BasicBlock* BB1, const BasicBlock* BB2, const BasicBlock* BB0);
175
+ virtual Condition getPHIComplementCond(const SVFBasicBlock* BB1, const SVFBasicBlock* BB2, const SVFBasicBlock* BB0);
179
176
 
180
177
  inline void clearCFCond()
181
178
  {
@@ -215,7 +212,7 @@ public:
215
212
 
216
213
  /// Get/Set control-flow conditions
217
214
  //@{
218
- inline bool setCFCond(const BasicBlock* bb, const Condition& cond)
215
+ inline bool setCFCond(const SVFBasicBlock* bb, const Condition& cond)
219
216
  {
220
217
  BBToCondMap::iterator it = bbToCondMap.find(bb);
221
218
  // until a fixed-point is reached (condition is not changed)
@@ -225,7 +222,7 @@ public:
225
222
  bbToCondMap[bb] = cond;
226
223
  return true;
227
224
  }
228
- inline Condition getCFCond(const BasicBlock* bb) const
225
+ inline Condition getCFCond(const SVFBasicBlock* bb) const
229
226
  {
230
227
  BBToCondMap::const_iterator it = bbToCondMap.find(bb);
231
228
  if(it==bbToCondMap.end())
@@ -238,7 +235,7 @@ public:
238
235
 
239
236
 
240
237
  /// mark neg Z3 expression
241
- inline void setNegCondInst(const Condition &condition, const Instruction *inst)
238
+ inline void setNegCondInst(const Condition &condition, const SVFInstruction* inst)
242
239
  {
243
240
  setCondInst(condition, inst);
244
241
  negConds.set(condition.id());
@@ -246,30 +243,30 @@ public:
246
243
  private:
247
244
 
248
245
  /// Allocate path condition for every basic block
249
- virtual void allocateForBB(const BasicBlock& bb);
246
+ virtual void allocateForBB(const SVFBasicBlock& bb);
250
247
 
251
248
  /// Get/Set a branch condition, and its terminator instruction
252
249
  //@{
253
250
  /// Set branch condition
254
- void setBranchCond(const BasicBlock *bb, const BasicBlock *succ, const Condition& cond);
251
+ void setBranchCond(const SVFBasicBlock* bb, const SVFBasicBlock* succ, const Condition& cond);
255
252
  /// Get branch condition
256
- Condition getBranchCond(const BasicBlock * bb, const BasicBlock *succ) const;
253
+ Condition getBranchCond(const SVFBasicBlock* bb, const SVFBasicBlock* succ) const;
257
254
  ///Get a condition, evaluate the value for conditions if necessary (e.g., testNull like express)
258
- Condition getEvalBrCond(const BasicBlock * bb, const BasicBlock *succ);
255
+ Condition getEvalBrCond(const SVFBasicBlock* bb, const SVFBasicBlock* succ);
259
256
  //@}
260
257
  /// Evaluate branch conditions
261
258
  //@{
262
259
  /// Evaluate the branch condtion
263
- Condition evaluateBranchCond(const BasicBlock * bb, const BasicBlock *succ) ;
260
+ Condition evaluateBranchCond(const SVFBasicBlock* bb, const SVFBasicBlock* succ) ;
264
261
  /// Evaluate loop exit branch
265
- Condition evaluateLoopExitBranch(const BasicBlock * bb, const BasicBlock *succ);
262
+ Condition evaluateLoopExitBranch(const SVFBasicBlock* bb, const SVFBasicBlock* succ);
266
263
  /// Return branch condition after evaluating test null like expression
267
- Condition evaluateTestNullLikeExpr(const BranchStmt* branchStmt, const BasicBlock *succ);
264
+ Condition evaluateTestNullLikeExpr(const BranchStmt* branchStmt, const SVFBasicBlock* succ);
268
265
  /// Return condition when there is a branch calls program exit
269
- Condition evaluateProgExit(const BranchStmt* branchStmt, const BasicBlock *succ);
266
+ Condition evaluateProgExit(const BranchStmt* branchStmt, const SVFBasicBlock* succ);
270
267
  /// Collect basic block contains program exit function call
271
- void collectBBCallingProgExit(const BasicBlock& bb);
272
- bool isBBCallsProgExit(const BasicBlock* bb);
268
+ void collectBBCallingProgExit(const SVFBasicBlock& bb);
269
+ bool isBBCallsProgExit(const SVFBasicBlock* bb);
273
270
  //@}
274
271
 
275
272
  /// Evaluate test null/not null like expressions
@@ -88,6 +88,9 @@ typedef llvm::LoopInfo LoopInfo;
88
88
  typedef llvm::User User;
89
89
 
90
90
  // LLVM Instructions
91
+ typedef llvm::CallInst CallInst;
92
+ typedef llvm::StoreInst StoreInst;
93
+ typedef llvm::LoadInst LoadInst;
91
94
  typedef llvm::AllocaInst AllocaInst;
92
95
  typedef llvm::AtomicCmpXchgInst AtomicCmpXchgInst;
93
96
  typedef llvm::AtomicRMWInst AtomicRMWInst;
@@ -183,6 +186,7 @@ namespace dwarf = llvm::dwarf;
183
186
 
184
187
  // Iterators.
185
188
  typedef llvm::inst_iterator inst_iterator;
189
+ typedef llvm::const_inst_iterator const_inst_iterator;
186
190
  typedef llvm::gep_type_iterator gep_type_iterator;
187
191
  typedef llvm::bridge_gep_iterator bridge_gep_iterator;
188
192
  typedef llvm::const_inst_iterator const_inst_iterator;
@@ -204,6 +208,12 @@ typedef llvm::VectorType VectorType;
204
208
  typedef llvm::FunctionCallee FunctionCallee;
205
209
  #endif
206
210
 
211
+ /// LLVM Iterators
212
+ #if LLVM_VERSION_MAJOR >= 11
213
+ typedef llvm::const_succ_iterator succ_const_iterator;
214
+ #else
215
+ typedef llvm::succ_const_iterator succ_const_iterator;
216
+ #endif
207
217
  } // End namespace SVF
208
218
 
209
219
  #endif // SVF_FE_BASIC_TYPES_H
@@ -31,6 +31,7 @@
31
31
  #define CPPUtil_H_
32
32
 
33
33
  #include "Util/BasicTypes.h"
34
+ #include "SVF-FE/BasicTypes.h"
34
35
 
35
36
  namespace SVF
36
37
  {
@@ -53,13 +54,13 @@ struct DemangledName
53
54
  struct DemangledName demangle(const std::string &name);
54
55
 
55
56
  std::string getBeforeBrackets(const std::string &name);
56
- bool isValVtbl(const Value *val);
57
+ bool isValVtbl(const Value* val);
57
58
  bool isLoadVtblInst(const LoadInst *loadInst);
58
59
  bool isVirtualCallSite(CallSite cs);
59
- bool isConstructor(const Function *F);
60
- bool isDestructor(const Function *F);
61
- bool isCPPThunkFunction(const Function *F);
62
- const Function *getThunkTarget(const Function *F);
60
+ bool isConstructor(const Function* F);
61
+ bool isDestructor(const Function* F);
62
+ bool isCPPThunkFunction(const Function* F);
63
+ const Function* getThunkTarget(const Function* F);
63
64
 
64
65
  /*
65
66
  * VtableA = {&A::foo}
@@ -83,10 +84,10 @@ const Function *getThunkTarget(const Function *F);
83
84
  * getClassNameFromType(type of p) return type A
84
85
  */
85
86
  const Argument* getConstructorThisPtr(const Function* fun);
86
- const Value *getVCallThisPtr(CallSite cs);
87
- const Value *getVCallVtblPtr(CallSite cs);
87
+ const Value* getVCallThisPtr(CallSite cs);
88
+ const Value* getVCallVtblPtr(CallSite cs);
88
89
  u64_t getVCallIdx(CallSite cs);
89
- std::string getClassNameFromVtblObj(const Value *value);
90
+ std::string getClassNameFromVtblObj(const Value* value);
90
91
  std::string getClassNameFromType(const Type *ty);
91
92
  std::string getClassNameOfThisPtr(CallSite cs);
92
93
  std::string getFunNameOfVCallSite(CallSite cs);
@@ -172,13 +172,13 @@ public:
172
172
  }
173
173
 
174
174
  /// Returns the vector of virtual function vectors.
175
- const std::vector<std::vector<const Function *>> &getVfnVectors(void) const
175
+ const std::vector<std::vector<const Function* >> &getVfnVectors(void) const
176
176
  {
177
177
  return vfnVectors;
178
178
  }
179
179
 
180
180
  /// Return the nth virtual function vector in the vtable.
181
- std::vector<const Function *> &getVfnVector(unsigned n)
181
+ std::vector<const Function* > &getVfnVector(unsigned n)
182
182
  {
183
183
  if (vfnVectors.size() < n + 1)
184
184
  {
@@ -197,7 +197,7 @@ private:
197
197
  std::string typeName;
198
198
  size_t flags;
199
199
  /// The virtual functions which this class actually defines/overrides.
200
- std::vector<const Function *> primaryVTable;
200
+ std::vector<const Function* > primaryVTable;
201
201
  /// If a vtable is split into more than one vfn vector for multiple inheritance,
202
202
  /// 0 would be the primary base + this classes virtual functions, 1 would be
203
203
  /// the second parent, 2 would be third parent, etc.
@@ -406,7 +406,7 @@ private:
406
406
  /// Retrieves the metadata associated with a *virtual* callsite.
407
407
  const DIType *getCSStaticType(CallSite cs) const
408
408
  {
409
- MDNode *md = cs.getInstruction()->getMetadata(cppUtil::ctir::derefMDName);
409
+ MDNode *md = cs.getInstruction()->getLLVMInstruction()->getMetadata(cppUtil::ctir::derefMDName);
410
410
  assert(md != nullptr && "Missing type metadata at virtual callsite");
411
411
  DIType *diType = SVFUtil::dyn_cast<DIType>(md);
412
412
  assert(diType != nullptr && "Incorrect metadata type at virtual callsite");
@@ -75,7 +75,7 @@ public:
75
75
  const SCEV *scev;
76
76
  const Value* start;
77
77
  const Value* step;
78
- const Value *ptr;
78
+ const Value* ptr;
79
79
  bool inloop;
80
80
  unsigned tripcount;
81
81
 
@@ -95,7 +95,7 @@ public:
95
95
  return operator*();
96
96
  }
97
97
 
98
- Value *getOperand() const
98
+ Value* getOperand() const
99
99
  {
100
100
  return const_cast<Value*>(&**OpIt);
101
101
  }
@@ -41,14 +41,14 @@ class ICFGBuilder
41
41
 
42
42
  public:
43
43
 
44
- typedef std::vector<const Instruction*> InstVec;
45
- typedef Set<const Instruction*> BBSet;
44
+ typedef std::vector<const SVFInstruction*> InstVec;
45
+ typedef Set<const SVFInstruction*> BBSet;
46
46
 
47
47
  private:
48
48
  ICFG* icfg;
49
49
 
50
50
  public:
51
- typedef FIFOWorkList<const Instruction*> WorkList;
51
+ typedef FIFOWorkList<const SVFInstruction*> WorkList;
52
52
 
53
53
  ICFGBuilder(ICFG* i): icfg(i)
54
54
  {
@@ -69,10 +69,10 @@ private:
69
69
  void connectGlobalToProgEntry(SVFModule* svfModule);
70
70
 
71
71
  /// Add/Get an inter block ICFGNode
72
- InterICFGNode* getOrAddInterBlockICFGNode(const Instruction* inst);
72
+ InterICFGNode* getOrAddInterBlockICFGNode(const SVFInstruction* inst);
73
73
 
74
74
  /// Add/Get a basic block ICFGNode
75
- inline ICFGNode* getOrAddBlockICFGNode(const Instruction* inst)
75
+ inline ICFGNode* getOrAddBlockICFGNode(const SVFInstruction* inst)
76
76
  {
77
77
  if(SVFUtil::isNonInstricCallSite(inst))
78
78
  return getOrAddInterBlockICFGNode(inst);
@@ -81,21 +81,21 @@ private:
81
81
  }
82
82
 
83
83
  /// Create edges between ICFG nodes across functions
84
- void addICFGInterEdges(const Instruction* cs, const SVFFunction* callee);
84
+ void addICFGInterEdges(const SVFInstruction* cs, const SVFFunction* callee);
85
85
 
86
86
  /// Add a call node
87
- inline CallICFGNode* getCallICFGNode(const Instruction* cs)
87
+ inline CallICFGNode* getCallICFGNode(const SVFInstruction* cs)
88
88
  {
89
89
  return icfg->getCallICFGNode(cs);
90
90
  }
91
91
  /// Add a return node
92
- inline RetICFGNode* getRetICFGNode(const Instruction* cs)
92
+ inline RetICFGNode* getRetICFGNode(const SVFInstruction* cs)
93
93
  {
94
94
  return icfg->getRetICFGNode(cs);
95
95
  }
96
96
 
97
97
  /// Add and get IntraBlock ICFGNode
98
- IntraICFGNode* getOrAddIntraBlockICFGNode(const Instruction* inst)
98
+ IntraICFGNode* getOrAddIntraBlockICFGNode(const SVFInstruction* inst)
99
99
  {
100
100
  return icfg->getIntraICFGNode(inst);
101
101
  }
@@ -108,17 +108,17 @@ private:
108
108
  }
109
109
 
110
110
  // Deduce the LLVM value's type, and process the metadata accordingly
111
- void processPAGNode(const Value *value, SVF::NodeID nodeId, bool writeFlag)
111
+ void processPAGNode(const Value* value, SVF::NodeID nodeId, bool writeFlag)
112
112
  {
113
- if (auto instruction = const_cast<Instruction *>(SVFUtil::dyn_cast<Instruction>(value)))
113
+ if (auto instruction = const_cast<Instruction* >(SVFUtil::dyn_cast<Instruction>(value)))
114
114
  {
115
115
  processInstructionNode(instruction, nodeId, writeFlag);
116
116
  }
117
- else if (auto argument = const_cast<Argument *>(SVFUtil::dyn_cast<Argument>(value)))
117
+ else if (auto argument = const_cast<Argument* >(SVFUtil::dyn_cast<Argument>(value)))
118
118
  {
119
119
  processArgumentNode(argument, nodeId, writeFlag);
120
120
  }
121
- else if (auto function = const_cast<Function *>(SVFUtil::dyn_cast<Function>(value)))
121
+ else if (auto function = const_cast<Function* >(SVFUtil::dyn_cast<Function>(value)))
122
122
  {
123
123
  processFunctionNode(function, nodeId, writeFlag);
124
124
  }
@@ -126,7 +126,7 @@ private:
126
126
  {
127
127
  processGlobalVarNode(globalVar, nodeId, writeFlag);
128
128
  }
129
- else if (auto basicBlock = const_cast<BasicBlock *>(SVFUtil::dyn_cast<BasicBlock>(value)))
129
+ else if (auto basicBlock = const_cast<BasicBlock* >(SVFUtil::dyn_cast<BasicBlock>(value)))
130
130
  {
131
131
  processBasicBlockNode(basicBlock, nodeId, writeFlag);
132
132
  }
@@ -145,7 +145,7 @@ private:
145
145
  }
146
146
  }
147
147
 
148
- void processInstructionNode(Instruction *instruction, const SVF::NodeID &nodeId, bool writeFlag)
148
+ void processInstructionNode(Instruction* instruction, const SVF::NodeID &nodeId, bool writeFlag)
149
149
  {
150
150
  std::string label = "inode-" + std::to_string(nodeId);
151
151
 
@@ -163,7 +163,7 @@ private:
163
163
  }
164
164
  }
165
165
 
166
- void processArgumentNode(Argument *argument, const SVF::NodeID &nodeId, bool writeFlag)
166
+ void processArgumentNode(Argument* argument, const SVF::NodeID &nodeId, bool writeFlag)
167
167
  {
168
168
  std::string label = "anode-" + std::to_string(nodeId);
169
169
 
@@ -181,7 +181,7 @@ private:
181
181
  }
182
182
  }
183
183
 
184
- void processFunctionNode(Function *function, const SVF::NodeID &nodeId, bool writeFlag)
184
+ void processFunctionNode(Function* function, const SVF::NodeID &nodeId, bool writeFlag)
185
185
  {
186
186
  std::string label = "fnode-" + std::to_string(nodeId);
187
187
 
@@ -217,7 +217,7 @@ private:
217
217
  }
218
218
  }
219
219
 
220
- void processBasicBlockNode(BasicBlock *basicBlock, const SVF::NodeID &nodeId, bool writeFlag)
220
+ void processBasicBlockNode(BasicBlock* basicBlock, const SVF::NodeID &nodeId, bool writeFlag)
221
221
  {
222
222
  std::string label = "bnode-" + std::to_string(nodeId);
223
223