svf-lib 1.0.1289 → 1.0.1291

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 (161) hide show
  1. package/SVF-linux/Release-build/lib/libSvf.a +0 -0
  2. package/SVF-linux/include/CFL/CFLAlias.h +1 -1
  3. package/SVF-linux/include/CFL/CFLBase.h +1 -1
  4. package/SVF-linux/include/CFL/CFLGrammar.h +1 -1
  5. package/SVF-linux/include/DDA/DDAClient.h +2 -2
  6. package/SVF-linux/include/DDA/DDAPass.h +3 -3
  7. package/SVF-linux/include/Graphs/CHG.h +5 -5
  8. package/SVF-linux/include/Graphs/ConsG.h +1 -1
  9. package/SVF-linux/include/Graphs/ConsGEdge.h +1 -1
  10. package/SVF-linux/include/Graphs/GenericGraph.h +1 -1
  11. package/SVF-linux/include/Graphs/ICFG.h +1 -1
  12. package/SVF-linux/include/Graphs/ICFGEdge.h +3 -3
  13. package/SVF-linux/include/Graphs/IRGraph.h +13 -9
  14. package/SVF-linux/include/Graphs/PTACallGraph.h +1 -1
  15. package/SVF-linux/include/Graphs/SVFGOPT.h +2 -2
  16. package/SVF-linux/include/Graphs/ThreadCallGraph.h +2 -2
  17. package/SVF-linux/include/Graphs/VFG.h +1 -1
  18. package/SVF-linux/include/Graphs/VFGNode.h +7 -7
  19. package/SVF-linux/include/MSSA/MemRegion.h +2 -2
  20. package/SVF-linux/include/MTA/LockAnalysis.h +1 -4
  21. package/SVF-linux/include/MTA/MHP.h +22 -31
  22. package/SVF-linux/include/MTA/MTA.h +13 -32
  23. package/SVF-linux/include/MTA/MTAResultValidator.h +17 -16
  24. package/SVF-linux/include/MTA/MTAStat.h +1 -1
  25. package/SVF-linux/include/MTA/TCT.h +25 -18
  26. package/SVF-linux/include/MemoryModel/AbstractPointsToDS.h +1 -1
  27. package/SVF-linux/include/MemoryModel/ConditionalPT.h +3 -2
  28. package/SVF-linux/include/MemoryModel/LocationSet.h +4 -4
  29. package/SVF-linux/include/MemoryModel/MutablePointsToDS.h +1 -1
  30. package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +1 -1
  31. package/SVF-linux/include/MemoryModel/PointerAnalysis.h +5 -4
  32. package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +4 -4
  33. package/SVF-linux/include/MemoryModel/PointsTo.h +1 -1
  34. package/SVF-linux/include/MemoryModel/SVFLoop.h +1 -1
  35. package/SVF-linux/include/SABER/DoubleFreeChecker.h +2 -2
  36. package/SVF-linux/include/SABER/FileChecker.h +2 -2
  37. package/SVF-linux/include/SABER/LeakChecker.h +2 -2
  38. package/SVF-linux/include/SABER/ProgSlice.h +0 -3
  39. package/SVF-linux/include/SABER/SaberCondAllocator.h +7 -9
  40. package/SVF-linux/include/SABER/SaberSVFGBuilder.h +1 -1
  41. package/SVF-linux/include/SVF-LLVM/BasicTypes.h +248 -0
  42. package/SVF-linux/include/SVF-LLVM/BreakConstantExpr.h +94 -0
  43. package/SVF-linux/include/SVF-LLVM/CHGBuilder.h +73 -0
  44. package/SVF-linux/include/SVF-LLVM/CPPUtil.h +130 -0
  45. package/SVF-linux/include/SVF-LLVM/DCHG.h +481 -0
  46. package/SVF-linux/include/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
  47. package/SVF-linux/include/SVF-LLVM/ICFGBuilder.h +106 -0
  48. package/SVF-linux/include/SVF-LLVM/IRAnnotator.h +323 -0
  49. package/SVF-linux/include/SVF-LLVM/LLVMLoopAnalysis.h +59 -0
  50. package/SVF-linux/include/SVF-LLVM/LLVMModule.h +358 -0
  51. package/SVF-linux/include/SVF-LLVM/LLVMUtil.h +405 -0
  52. package/SVF-linux/include/SVF-LLVM/SVFIRBuilder.h +413 -0
  53. package/SVF-linux/include/SVF-LLVM/SymbolTableBuilder.h +113 -0
  54. package/SVF-linux/include/SVFIR/PAGBuilderFromFile.h +80 -0
  55. package/SVF-linux/include/SVFIR/SVFIR.h +661 -0
  56. package/SVF-linux/include/SVFIR/SVFModule.h +233 -0
  57. package/SVF-linux/include/SVFIR/SVFStatements.h +1101 -0
  58. package/SVF-linux/include/SVFIR/SVFType.h +514 -0
  59. package/SVF-linux/include/SVFIR/SVFValue.h +1129 -0
  60. package/SVF-linux/include/SVFIR/SVFVariables.h +721 -0
  61. package/SVF-linux/include/SVFIR/SymbolTableInfo.h +597 -0
  62. package/SVF-linux/include/Util/Annotator.h +1 -1
  63. package/SVF-linux/include/Util/CallGraphBuilder.h +74 -0
  64. package/SVF-linux/include/Util/Casting.h +1 -3
  65. package/SVF-linux/include/Util/CoreBitVector.h +1 -1
  66. package/SVF-linux/include/Util/CxtStmt.h +8 -8
  67. package/SVF-linux/include/Util/DPItem.h +1 -1
  68. package/SVF-linux/include/Util/ExtAPI.h +1 -1
  69. package/SVF-linux/include/Util/NodeIDAllocator.h +1 -1
  70. package/SVF-linux/include/Util/Options.h +1 -0
  71. package/SVF-linux/include/Util/PTAStat.h +1 -1
  72. package/SVF-linux/include/Util/SCC.h +1 -1
  73. package/SVF-linux/include/Util/SVFUtil.h +26 -95
  74. package/SVF-linux/include/Util/ThreadAPI.h +27 -27
  75. package/SVF-linux/include/Util/WorkList.h +1 -1
  76. package/SVF-linux/include/Util/Z3Expr.h +1 -1
  77. package/SVF-linux/include/WPA/Andersen.h +1 -1
  78. package/SVF-linux/include/WPA/CSC.h +1 -1
  79. package/SVF-linux/include/WPA/TypeAnalysis.h +0 -3
  80. package/SVF-linux/include/WPA/WPAPass.h +8 -8
  81. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  82. package/SVF-osx/include/CFL/CFLAlias.h +1 -1
  83. package/SVF-osx/include/CFL/CFLBase.h +1 -1
  84. package/SVF-osx/include/CFL/CFLGrammar.h +1 -1
  85. package/SVF-osx/include/DDA/DDAClient.h +2 -2
  86. package/SVF-osx/include/DDA/DDAPass.h +3 -3
  87. package/SVF-osx/include/Graphs/CHG.h +5 -5
  88. package/SVF-osx/include/Graphs/ConsG.h +1 -1
  89. package/SVF-osx/include/Graphs/ConsGEdge.h +1 -1
  90. package/SVF-osx/include/Graphs/GenericGraph.h +1 -1
  91. package/SVF-osx/include/Graphs/ICFG.h +1 -1
  92. package/SVF-osx/include/Graphs/ICFGEdge.h +3 -3
  93. package/SVF-osx/include/Graphs/IRGraph.h +13 -9
  94. package/SVF-osx/include/Graphs/PTACallGraph.h +1 -1
  95. package/SVF-osx/include/Graphs/SVFGOPT.h +2 -2
  96. package/SVF-osx/include/Graphs/ThreadCallGraph.h +2 -2
  97. package/SVF-osx/include/Graphs/VFG.h +1 -1
  98. package/SVF-osx/include/Graphs/VFGNode.h +7 -7
  99. package/SVF-osx/include/MSSA/MemRegion.h +2 -2
  100. package/SVF-osx/include/MTA/LockAnalysis.h +1 -4
  101. package/SVF-osx/include/MTA/MHP.h +22 -31
  102. package/SVF-osx/include/MTA/MTA.h +13 -32
  103. package/SVF-osx/include/MTA/MTAResultValidator.h +17 -16
  104. package/SVF-osx/include/MTA/MTAStat.h +1 -1
  105. package/SVF-osx/include/MTA/TCT.h +25 -18
  106. package/SVF-osx/include/MemoryModel/AbstractPointsToDS.h +1 -1
  107. package/SVF-osx/include/MemoryModel/ConditionalPT.h +3 -2
  108. package/SVF-osx/include/MemoryModel/LocationSet.h +4 -4
  109. package/SVF-osx/include/MemoryModel/MutablePointsToDS.h +1 -1
  110. package/SVF-osx/include/MemoryModel/PersistentPointsToCache.h +1 -1
  111. package/SVF-osx/include/MemoryModel/PointerAnalysis.h +5 -4
  112. package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +4 -4
  113. package/SVF-osx/include/MemoryModel/PointsTo.h +1 -1
  114. package/SVF-osx/include/MemoryModel/SVFLoop.h +1 -1
  115. package/SVF-osx/include/SABER/DoubleFreeChecker.h +2 -2
  116. package/SVF-osx/include/SABER/FileChecker.h +2 -2
  117. package/SVF-osx/include/SABER/LeakChecker.h +2 -2
  118. package/SVF-osx/include/SABER/ProgSlice.h +0 -3
  119. package/SVF-osx/include/SABER/SaberCondAllocator.h +7 -9
  120. package/SVF-osx/include/SABER/SaberSVFGBuilder.h +1 -1
  121. package/SVF-osx/include/SVF-LLVM/BasicTypes.h +248 -0
  122. package/SVF-osx/include/SVF-LLVM/BreakConstantExpr.h +94 -0
  123. package/SVF-osx/include/SVF-LLVM/CHGBuilder.h +73 -0
  124. package/SVF-osx/include/SVF-LLVM/CPPUtil.h +130 -0
  125. package/SVF-osx/include/SVF-LLVM/DCHG.h +481 -0
  126. package/SVF-osx/include/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
  127. package/SVF-osx/include/SVF-LLVM/ICFGBuilder.h +106 -0
  128. package/SVF-osx/include/SVF-LLVM/IRAnnotator.h +323 -0
  129. package/SVF-osx/include/SVF-LLVM/LLVMLoopAnalysis.h +59 -0
  130. package/SVF-osx/include/SVF-LLVM/LLVMModule.h +358 -0
  131. package/SVF-osx/include/SVF-LLVM/LLVMUtil.h +405 -0
  132. package/SVF-osx/include/SVF-LLVM/SVFIRBuilder.h +413 -0
  133. package/SVF-osx/include/SVF-LLVM/SymbolTableBuilder.h +113 -0
  134. package/SVF-osx/include/SVFIR/PAGBuilderFromFile.h +80 -0
  135. package/SVF-osx/include/SVFIR/SVFIR.h +661 -0
  136. package/SVF-osx/include/SVFIR/SVFModule.h +233 -0
  137. package/SVF-osx/include/SVFIR/SVFStatements.h +1101 -0
  138. package/SVF-osx/include/SVFIR/SVFType.h +514 -0
  139. package/SVF-osx/include/SVFIR/SVFValue.h +1129 -0
  140. package/SVF-osx/include/SVFIR/SVFVariables.h +721 -0
  141. package/SVF-osx/include/SVFIR/SymbolTableInfo.h +597 -0
  142. package/SVF-osx/include/Util/Annotator.h +1 -1
  143. package/SVF-osx/include/Util/CallGraphBuilder.h +74 -0
  144. package/SVF-osx/include/Util/Casting.h +1 -3
  145. package/SVF-osx/include/Util/CoreBitVector.h +1 -1
  146. package/SVF-osx/include/Util/CxtStmt.h +8 -8
  147. package/SVF-osx/include/Util/DPItem.h +1 -1
  148. package/SVF-osx/include/Util/ExtAPI.h +1 -1
  149. package/SVF-osx/include/Util/NodeIDAllocator.h +1 -1
  150. package/SVF-osx/include/Util/Options.h +1 -0
  151. package/SVF-osx/include/Util/PTAStat.h +1 -1
  152. package/SVF-osx/include/Util/SCC.h +1 -1
  153. package/SVF-osx/include/Util/SVFUtil.h +26 -95
  154. package/SVF-osx/include/Util/ThreadAPI.h +27 -27
  155. package/SVF-osx/include/Util/WorkList.h +1 -1
  156. package/SVF-osx/include/Util/Z3Expr.h +1 -1
  157. package/SVF-osx/include/WPA/Andersen.h +1 -1
  158. package/SVF-osx/include/WPA/CSC.h +1 -1
  159. package/SVF-osx/include/WPA/TypeAnalysis.h +0 -3
  160. package/SVF-osx/include/WPA/WPAPass.h +8 -8
  161. package/package.json +1 -1
@@ -30,7 +30,7 @@
30
30
  #ifndef INCLUDE_UTIL_CXTSTMT_H_
31
31
  #define INCLUDE_UTIL_CXTSTMT_H_
32
32
 
33
- #include "Util/BasicTypes.h"
33
+ #include "SVFIR/SVFValue.h"
34
34
 
35
35
  namespace SVF
36
36
  {
@@ -96,7 +96,7 @@ public:
96
96
  inline std::string cxtToStr() const
97
97
  {
98
98
  std::string str;
99
- raw_string_ostream rawstr(str);
99
+ std::stringstream rawstr(str);
100
100
  rawstr << "[:";
101
101
  for(CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it!=eit; ++it)
102
102
  {
@@ -108,7 +108,7 @@ public:
108
108
  /// Dump CxtStmt
109
109
  inline void dump() const
110
110
  {
111
- SVFUtil::outs() << "[ Current Stmt: " << SVFUtil::getSourceLoc(inst->getLLVMInstruction()) << " " << SVFUtil::value2String(inst->getLLVMInstruction()) << "\t Contexts: " << cxtToStr() << " ]\n";
111
+ SVFUtil::outs() << "[ Current Stmt: " << inst->getSourceLoc() << " " << inst->toString() << "\t Contexts: " << cxtToStr() << " ]\n";
112
112
  }
113
113
 
114
114
  protected:
@@ -174,7 +174,7 @@ public:
174
174
  /// Dump CxtThreadStmt
175
175
  inline void dump() const
176
176
  {
177
- SVFUtil::outs() << "[ Current Thread id: " << tid << " Stmt: " << SVFUtil::getSourceLoc(inst->getLLVMInstruction()) << " " << SVFUtil::value2String(inst->getLLVMInstruction()) << "\t Contexts: " << cxtToStr() << " ]\n";
177
+ SVFUtil::outs() << "[ Current Thread id: " << tid << " Stmt: " << inst->getSourceLoc() << " " << inst->toString() << "\t Contexts: " << cxtToStr() << " ]\n";
178
178
  }
179
179
 
180
180
  private:
@@ -244,7 +244,7 @@ public:
244
244
  inline std::string cxtToStr() const
245
245
  {
246
246
  std::string str;
247
- raw_string_ostream rawstr(str);
247
+ std::stringstream rawstr(str);
248
248
  rawstr << "[:";
249
249
  for(CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it!=eit; ++it)
250
250
  {
@@ -282,8 +282,8 @@ public:
282
282
 
283
283
  if(forksite)
284
284
  {
285
- SVFUtil::outs() << "[ Thread: $" << SVFUtil::getSourceLoc(forksite->getLLVMInstruction()) << "$ "
286
- << SVFUtil::value2String(forksite->getLLVMInstruction()) << "\t Contexts: " << cxtToStr()
285
+ SVFUtil::outs() << "[ Thread: $" << forksite->getSourceLoc() << "$ "
286
+ << forksite->toString() << "\t Contexts: " << cxtToStr()
287
287
  << loop << cycle <<" ]\n";
288
288
  }
289
289
  else
@@ -365,7 +365,7 @@ public:
365
365
  inline std::string cxtToStr() const
366
366
  {
367
367
  std::string str;
368
- raw_string_ostream rawstr(str);
368
+ std::stringstream rawstr(str);
369
369
  rawstr << "[:";
370
370
  for (CallStrCxt::const_iterator it = cxt.begin(), eit = cxt.end(); it != eit; ++it)
371
371
  {
@@ -360,7 +360,7 @@ public:
360
360
  inline std::string toString() const
361
361
  {
362
362
  std::string str;
363
- raw_string_ostream rawstr(str);
363
+ std::stringstream rawstr(str);
364
364
  rawstr << "[:";
365
365
  for(CallStrCxt::const_iterator it = context.begin(), eit = context.end(); it!=eit; ++it)
366
366
  {
@@ -30,7 +30,7 @@
30
30
  #ifndef __ExtAPI_H
31
31
  #define __ExtAPI_H
32
32
 
33
- #include "Util/BasicTypes.h"
33
+ #include "SVFIR/SVFValue.h"
34
34
  #include "Util/cJSON.h"
35
35
  #include "Util/config.h"
36
36
  #include <string>
@@ -4,7 +4,7 @@
4
4
  #define NODEIDALLOCATOR_H_
5
5
 
6
6
  #include "FastCluster/fastcluster.h"
7
- #include "Util/SVFBasicTypes.h"
7
+ #include "SVFIR/SVFType.h"
8
8
  #include "MemoryModel/PointsTo.h"
9
9
 
10
10
  namespace SVF
@@ -10,6 +10,7 @@
10
10
  #include "Util/NodeIDAllocator.h"
11
11
  #include "MSSA/MemSSA.h"
12
12
  #include "WPA/WPAPass.h"
13
+ #include <llvm/Support/CommandLine.h> // for command line options
13
14
 
14
15
  namespace SVF
15
16
  {
@@ -30,7 +30,7 @@
30
30
  #ifndef ANDERSENSTAT_H_
31
31
  #define ANDERSENSTAT_H_
32
32
 
33
- #include "Util/BasicTypes.h"
33
+ #include "SVFIR/SVFValue.h"
34
34
  #include "MemoryModel/PointsTo.h"
35
35
  #include "Util/SVFStat.h"
36
36
  #include <iostream>
@@ -40,7 +40,7 @@
40
40
  #ifndef SCC_H_
41
41
  #define SCC_H_
42
42
 
43
- #include "Util/BasicTypes.h" // for NodeBS
43
+ #include "SVFIR/SVFValue.h" // for NodeBS
44
44
  #include <limits.h>
45
45
  #include <stack>
46
46
  #include <map>
@@ -31,8 +31,8 @@
31
31
  #define AnalysisUtil_H_
32
32
 
33
33
  #include "FastCluster/fastcluster.h"
34
- #include "SVF-FE/LLVMModule.h"
35
- #include "Util/BasicTypes.h"
34
+ #include "SVF-LLVM/LLVMModule.h"
35
+ #include "SVFIR/SVFValue.h"
36
36
  #include "MemoryModel/PointsTo.h"
37
37
  #include <time.h>
38
38
 
@@ -164,47 +164,24 @@ inline NodeBS ptsToNodeBS(const PointsTo &pts)
164
164
  typedef OrderedSet<PointsTo, equalPointsTo> PointsToList;
165
165
  void dumpPointsToList(const PointsToList& ptl);
166
166
 
167
- inline bool isIntrinsicFun(const Function* func)
168
- {
169
- if (func && (func->getIntrinsicID() == llvm::Intrinsic::donothing ||
170
- func->getIntrinsicID() == llvm::Intrinsic::dbg_addr ||
171
- func->getIntrinsicID() == llvm::Intrinsic::dbg_declare ||
172
- func->getIntrinsicID() == llvm::Intrinsic::dbg_label ||
173
- func->getIntrinsicID() == llvm::Intrinsic::dbg_value))
174
- {
175
- return true;
176
- }
177
- return false;
178
- }
179
-
180
- /// Return true if it is an intrinsic instruction
181
- inline bool isIntrinsicInst(const SVFInstruction* inst)
182
- {
183
- if (const llvm::CallBase* call = llvm::dyn_cast<llvm::CallBase>(inst->getLLVMInstruction()))
184
- {
185
- const Function* func = call->getCalledFunction();
186
- if (isIntrinsicFun(func))
187
- {
188
- return true;
189
- }
190
- }
191
- return false;
192
- }
167
+ /// Return true if it is an llvm intrinsic instruction
168
+ bool isIntrinsicInst(const SVFInstruction* inst);
193
169
  //@}
194
170
 
195
171
  /// Whether an instruction is a call or invoke instruction
196
172
  inline bool isCallSite(const SVFInstruction* inst)
197
173
  {
198
- return SVFUtil::isa<CallBase>(inst->getLLVMInstruction());
174
+ return SVFUtil::isa<SVFCallInst>(inst);
199
175
  }
200
176
  /// Whether an instruction is a call or invoke instruction
201
- inline bool isCallSite(const Value* val)
177
+ inline bool isCallSite(const SVFValue* val)
202
178
  {
203
- if(SVFUtil::isa<CallBase>(val))
179
+ if(SVFUtil::isa<SVFCallInst>(val))
204
180
  return true;
205
181
  else
206
182
  return false;
207
183
  }
184
+
208
185
  /// Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls
209
186
  inline bool isNonInstricCallSite(const SVFInstruction* inst)
210
187
  {
@@ -214,7 +191,7 @@ inline bool isNonInstricCallSite(const SVFInstruction* inst)
214
191
  }
215
192
 
216
193
  /// Return LLVM callsite given an instruction
217
- inline CallSite getLLVMCallSite(const SVFInstruction* inst)
194
+ inline CallSite getSVFCallSite(const SVFInstruction* inst)
218
195
  {
219
196
  assert(isCallSite(inst) && "not a callsite?");
220
197
  CallSite cs(inst);
@@ -222,20 +199,14 @@ inline CallSite getLLVMCallSite(const SVFInstruction* inst)
222
199
  }
223
200
 
224
201
  /// Return LLVM callsite given a value
225
- inline CallSite getLLVMCallSite(const Value* value)
202
+ inline CallSite getSVFCallSite(const SVFValue* value)
226
203
  {
227
204
  assert(isCallSite(value) && "not a callsite?");
228
- const SVFInstruction* svfInst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(SVFUtil::cast<CallBase>(value));
205
+ const SVFCallInst* svfInst = SVFUtil::cast<SVFCallInst>(value);
229
206
  CallSite cs(svfInst);
230
207
  return cs;
231
208
  }
232
209
 
233
- /// Get the corresponding Function based on its name
234
- inline const SVFFunction* getFunction(std::string name)
235
- {
236
- return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(name);
237
- }
238
-
239
210
  /// Split into two substrings around the first occurrence of a separator string.
240
211
  inline std::vector<std::string> split(const std::string& s, char seperator)
241
212
  {
@@ -251,35 +222,11 @@ inline std::vector<std::string> split(const std::string& s, char seperator)
251
222
  return output;
252
223
  }
253
224
 
254
- /// find the unique defined global across multiple modules
255
- inline const Value* getGlobalRep(const Value* val)
256
- {
257
- if(const GlobalVariable* gvar = SVFUtil::dyn_cast<GlobalVariable>(val))
258
- {
259
- if (LLVMModuleSet::getLLVMModuleSet()->hasGlobalRep(gvar))
260
- val = LLVMModuleSet::getLLVMModuleSet()->getGlobalRep(gvar);
261
- }
262
- return val;
263
- }
264
-
265
- /// Get the definition of a function across multiple modules
266
- inline const SVFFunction* getDefFunForMultipleModule(const Function* fun)
267
- {
268
- if(fun == nullptr) return nullptr;
269
- LLVMModuleSet* llvmModuleset = LLVMModuleSet::getLLVMModuleSet();
270
- const SVFFunction* svfFun = llvmModuleset->getSVFFunction(fun);
271
- if (fun->isDeclaration() && llvmModuleset->hasDefinition(fun))
272
- svfFun = llvmModuleset->getSVFFunction(LLVMModuleSet::getLLVMModuleSet()->getDefinition(fun));
273
- return svfFun;
274
- }
275
-
276
225
  /// Return callee of a callsite. Return null if this is an indirect call
277
226
  //@{
278
227
  inline const SVFFunction* getCallee(const CallSite cs)
279
228
  {
280
- // FIXME: do we need to strip-off the casts here to discover more library functions
281
- const Function* callee = SVFUtil::dyn_cast<Function>(cs.getCalledValue()->stripPointerCasts());
282
- return getDefFunForMultipleModule(callee);
229
+ return cs.getCalledFunction();
283
230
  }
284
231
 
285
232
  inline const SVFFunction* getCallee(const SVFInstruction *inst)
@@ -291,13 +238,6 @@ inline const SVFFunction* getCallee(const SVFInstruction *inst)
291
238
  }
292
239
  //@}
293
240
 
294
- /// Return source code including line number and file name from debug information
295
- //@{
296
- std::string getSourceLoc(const Value* val);
297
- std::string getSourceLocOfFunction(const Function* F);
298
- const std::string value2String(const Value* value);
299
- //@}
300
-
301
241
  /// Given a map mapping points-to sets to a count, adds from into to.
302
242
  template <typename Data>
303
243
  void mergePtsOccMaps(Map<Data, unsigned> &to, const Map<Data, unsigned> from)
@@ -444,42 +384,33 @@ inline bool isProgExitFunction (const SVFFunction * fun)
444
384
  fun->getName() == "__assert_fail" );
445
385
  }
446
386
 
447
- /// Return true if the value refers to constant data, e.g., i32 0
448
- inline bool isConstantData(const Value* val)
387
+ /// Return true if this argument belongs to an uncalled function
388
+ inline bool isArgOfUncalledFunction(const SVFValue* svfval)
449
389
  {
450
- return SVFUtil::isa<ConstantData>(val)
451
- || SVFUtil::isa<ConstantAggregate>(val)
452
- || SVFUtil::isa<MetadataAsValue>(val)
453
- || SVFUtil::isa<BlockAddress>(val);
390
+ if(const SVFArgument* arg = SVFUtil::dyn_cast<SVFArgument>(svfval))
391
+ return arg->isArgOfUncalledFunction();
392
+ else
393
+ return false;
454
394
  }
455
395
 
456
396
  /// Return thread fork function
457
397
  //@{
458
- inline const Value* getForkedFun(const CallSite cs)
398
+ inline const SVFValue* getForkedFun(const CallSite cs)
459
399
  {
460
400
  return ThreadAPI::getThreadAPI()->getForkedFun(cs);
461
401
  }
462
- inline const Value* getForkedFun(const SVFInstruction *inst)
402
+ inline const SVFValue* getForkedFun(const SVFInstruction *inst)
463
403
  {
464
404
  return ThreadAPI::getThreadAPI()->getForkedFun(inst);
465
405
  }
466
406
  //@}
467
407
 
468
- const std::string type2String(const Type* type);
469
-
470
408
  /// This function servers a allocation wrapper detector
471
409
  inline bool isAnAllocationWraper(const SVFInstruction*)
472
410
  {
473
411
  return false;
474
412
  }
475
413
 
476
- /// Return LLVM function if this value is
477
- inline const Function* getLLVMFunction(const Value* val)
478
- {
479
- const Function* fun = SVFUtil::dyn_cast<Function>(val->stripPointerCasts());
480
- return fun;
481
- }
482
-
483
414
  inline bool isExtCall(const CallSite cs)
484
415
  {
485
416
  return isExtCall(getCallee(cs));
@@ -671,11 +602,11 @@ inline bool isBarrierWaitCall(const SVFInstruction *inst)
671
602
 
672
603
  /// Return sole argument of the thread routine
673
604
  //@{
674
- inline const Value* getActualParmAtForkSite(const CallSite cs)
605
+ inline const SVFValue* getActualParmAtForkSite(const CallSite cs)
675
606
  {
676
607
  return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(cs);
677
608
  }
678
- inline const Value* getActualParmAtForkSite(const SVFInstruction *inst)
609
+ inline const SVFValue* getActualParmAtForkSite(const SVFInstruction *inst)
679
610
  {
680
611
  return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(inst);
681
612
  }
@@ -683,11 +614,11 @@ inline const Value* getActualParmAtForkSite(const SVFInstruction *inst)
683
614
 
684
615
  /// Return the task function of the parallel_for routine
685
616
  //@{
686
- inline const Value* getTaskFuncAtHareParForSite(const CallSite cs)
617
+ inline const SVFValue* getTaskFuncAtHareParForSite(const CallSite cs)
687
618
  {
688
619
  return ThreadAPI::getThreadAPI()->getTaskFuncAtHareParForSite(cs);
689
620
  }
690
- inline const Value* getTaskFuncAtHareParForSite(const SVFInstruction *inst)
621
+ inline const SVFValue* getTaskFuncAtHareParForSite(const SVFInstruction *inst)
691
622
  {
692
623
  return ThreadAPI::getThreadAPI()->getTaskFuncAtHareParForSite(inst);
693
624
  }
@@ -695,11 +626,11 @@ inline const Value* getTaskFuncAtHareParForSite(const SVFInstruction *inst)
695
626
 
696
627
  /// Return the task data argument of the parallel_for rountine
697
628
  //@{
698
- inline const Value* getTaskDataAtHareParForSite(const CallSite cs)
629
+ inline const SVFValue* getTaskDataAtHareParForSite(const CallSite cs)
699
630
  {
700
631
  return ThreadAPI::getThreadAPI()->getTaskDataAtHareParForSite(cs);
701
632
  }
702
- inline const Value* getTaskDataAtHareParForSite(const SVFInstruction *inst)
633
+ inline const SVFValue* getTaskDataAtHareParForSite(const SVFInstruction *inst)
703
634
  {
704
635
  return ThreadAPI::getThreadAPI()->getTaskDataAtHareParForSite(inst);
705
636
  }
@@ -30,7 +30,7 @@
30
30
  #ifndef THREADAPI_H_
31
31
  #define THREADAPI_H_
32
32
 
33
- #include "Util/BasicTypes.h"
33
+ #include "SVFIR/SVFValue.h"
34
34
 
35
35
  namespace SVF
36
36
  {
@@ -121,7 +121,7 @@ public:
121
121
  //@{
122
122
  const SVFFunction* getCallee(const SVFInstruction *inst) const;
123
123
  const SVFFunction* getCallee(const CallSite cs) const;
124
- const CallSite getLLVMCallSite(const SVFInstruction *inst) const;
124
+ const CallSite getSVFCallSite(const SVFInstruction *inst) const;
125
125
  //@}
126
126
 
127
127
  /// Return true if this call create a new thread
@@ -152,39 +152,39 @@ public:
152
152
  //@{
153
153
  /// Return the first argument of the call,
154
154
  /// Note that, it is the pthread_t pointer
155
- inline const Value* getForkedThread(const SVFInstruction *inst) const
155
+ inline const SVFValue* getForkedThread(const SVFInstruction *inst) const
156
156
  {
157
157
  assert(isTDFork(inst) && "not a thread fork function!");
158
- CallSite cs = getLLVMCallSite(inst);
158
+ CallSite cs = getSVFCallSite(inst);
159
159
  return cs.getArgument(0);
160
160
  }
161
- inline const Value* getForkedThread(CallSite cs) const
161
+ inline const SVFValue* getForkedThread(CallSite cs) const
162
162
  {
163
163
  return getForkedThread(cs.getInstruction());
164
164
  }
165
165
 
166
166
  /// Return the third argument of the call,
167
167
  /// Note that, it could be function type or a void* pointer
168
- inline const Value* getForkedFun(const SVFInstruction *inst) const
168
+ inline const SVFValue* getForkedFun(const SVFInstruction *inst) const
169
169
  {
170
170
  assert(isTDFork(inst) && "not a thread fork function!");
171
- CallSite cs = getLLVMCallSite(inst);
172
- return cs.getArgument(2)->stripPointerCasts();
171
+ CallSite cs = getSVFCallSite(inst);
172
+ return cs.getArgument(2);
173
173
  }
174
- inline const Value* getForkedFun(CallSite cs) const
174
+ inline const SVFValue* getForkedFun(CallSite cs) const
175
175
  {
176
176
  return getForkedFun(cs.getInstruction());
177
177
  }
178
178
 
179
179
  /// Return the forth argument of the call,
180
180
  /// Note that, it is the sole argument of start routine ( a void* pointer )
181
- inline const Value* getActualParmAtForkSite(const SVFInstruction *inst) const
181
+ inline const SVFValue* getActualParmAtForkSite(const SVFInstruction *inst) const
182
182
  {
183
183
  assert(isTDFork(inst) && "not a thread fork function!");
184
- CallSite cs = getLLVMCallSite(inst);
184
+ CallSite cs = getSVFCallSite(inst);
185
185
  return cs.getArgument(3);
186
186
  }
187
- inline const Value* getActualParmAtForkSite(CallSite cs) const
187
+ inline const SVFValue* getActualParmAtForkSite(CallSite cs) const
188
188
  {
189
189
  return getActualParmAtForkSite(cs.getInstruction());
190
190
  }
@@ -192,13 +192,13 @@ public:
192
192
 
193
193
  /// Get the task function (i.e., the 5th parameter) of the hare_parallel_for call
194
194
  //@{
195
- inline const Value* getTaskFuncAtHareParForSite(const SVFInstruction *inst) const
195
+ inline const SVFValue* getTaskFuncAtHareParForSite(const SVFInstruction *inst) const
196
196
  {
197
197
  assert(isHareParFor(inst) && "not a hare_parallel_for function!");
198
- CallSite cs = getLLVMCallSite(inst);
199
- return cs.getArgument(4)->stripPointerCasts();
198
+ CallSite cs = getSVFCallSite(inst);
199
+ return cs.getArgument(4);
200
200
  }
201
- inline const Value* getTaskFuncAtHareParForSite(CallSite cs) const
201
+ inline const SVFValue* getTaskFuncAtHareParForSite(CallSite cs) const
202
202
  {
203
203
  return getTaskFuncAtHareParForSite(cs.getInstruction());
204
204
  }
@@ -206,13 +206,13 @@ public:
206
206
 
207
207
  /// Get the task data (i.e., the 6th parameter) of the hare_parallel_for call
208
208
  //@{
209
- inline const Value* getTaskDataAtHareParForSite(const SVFInstruction *inst) const
209
+ inline const SVFValue* getTaskDataAtHareParForSite(const SVFInstruction *inst) const
210
210
  {
211
211
  assert(isHareParFor(inst) && "not a hare_parallel_for function!");
212
- CallSite cs = getLLVMCallSite(inst);
212
+ CallSite cs = getSVFCallSite(inst);
213
213
  return cs.getArgument(5);
214
214
  }
215
- inline const Value* getTaskDataAtHareParForSite(CallSite cs) const
215
+ inline const SVFValue* getTaskDataAtHareParForSite(CallSite cs) const
216
216
  {
217
217
  return getTaskDataAtHareParForSite(cs.getInstruction());
218
218
  }
@@ -234,20 +234,20 @@ public:
234
234
  //@{
235
235
  /// Return the first argument of the call,
236
236
  /// Note that, it is the pthread_t pointer
237
- const Value* getJoinedThread(const SVFInstruction *inst) const;
238
- inline const Value* getJoinedThread(CallSite cs) const
237
+ const SVFValue* getJoinedThread(const SVFInstruction *inst) const;
238
+ inline const SVFValue* getJoinedThread(CallSite cs) const
239
239
  {
240
240
  return getJoinedThread(cs.getInstruction());
241
241
  }
242
242
  /// Return the send argument of the call,
243
243
  /// Note that, it is the pthread_t pointer
244
- inline const Value* getRetParmAtJoinedSite(const SVFInstruction *inst) const
244
+ inline const SVFValue* getRetParmAtJoinedSite(const SVFInstruction *inst) const
245
245
  {
246
246
  assert(isTDJoin(inst) && "not a thread join function!");
247
- CallSite cs = getLLVMCallSite(inst);
247
+ CallSite cs = getSVFCallSite(inst);
248
248
  return cs.getArgument(1);
249
249
  }
250
- inline const Value* getRetParmAtJoinedSite(CallSite cs) const
250
+ inline const SVFValue* getRetParmAtJoinedSite(CallSite cs) const
251
251
  {
252
252
  return getRetParmAtJoinedSite(cs.getInstruction());
253
253
  }
@@ -296,13 +296,13 @@ public:
296
296
  /// Return lock value
297
297
  //@{
298
298
  /// First argument of pthread_mutex_lock/pthread_mutex_unlock
299
- inline const Value* getLockVal(const SVFInstruction *inst) const
299
+ inline const SVFValue* getLockVal(const SVFInstruction *inst) const
300
300
  {
301
301
  assert((isTDAcquire(inst) || isTDRelease(inst)) && "not a lock acquire or release function");
302
- CallSite cs = getLLVMCallSite(inst);
302
+ CallSite cs = getSVFCallSite(inst);
303
303
  return cs.getArgument(0);
304
304
  }
305
- inline const Value* getLockVal(CallSite cs) const
305
+ inline const SVFValue* getLockVal(CallSite cs) const
306
306
  {
307
307
  return getLockVal(cs.getInstruction());
308
308
  }
@@ -36,7 +36,7 @@
36
36
  #ifndef WORKLIST_H_
37
37
  #define WORKLIST_H_
38
38
 
39
- #include "Util/BasicTypes.h"
39
+ #include "SVFIR/SVFValue.h"
40
40
 
41
41
  #include <assert.h>
42
42
  #include <cstdlib>
@@ -30,7 +30,7 @@
30
30
  #define Z3_EXAMPLE_Z3EXPR_H
31
31
 
32
32
  #include "z3++.h"
33
- #include "Util/SVFBasicTypes.h"
33
+ #include "SVFIR/SVFType.h"
34
34
 
35
35
  namespace SVF
36
36
  {
@@ -38,7 +38,7 @@
38
38
  #include "MemoryModel/PointerAnalysisImpl.h"
39
39
  #include "WPA/WPAStat.h"
40
40
  #include "WPA/WPASolver.h"
41
- #include "MemoryModel/SVFIR.h"
41
+ #include "SVFIR/SVFIR.h"
42
42
  #include "Graphs/ConsG.h"
43
43
  #include "Util/Options.h"
44
44
 
@@ -31,7 +31,7 @@
31
31
  #define PROJECT_CSC_H
32
32
 
33
33
  #include "Util/SCC.h"
34
- #include "Util/BasicTypes.h" // for NodeBS
34
+ #include "SVFIR/SVFValue.h" // for NodeBS
35
35
  #include "Graphs/ConsG.h"
36
36
  #include "Util/WorkList.h"
37
37
  #include <limits.h>
@@ -76,9 +76,6 @@ public:
76
76
  return (pta->getAnalysisTy() == TypeCPP_WPA);
77
77
  }
78
78
  //@}
79
-
80
- private:
81
- Set<CallSite> virtualCallSites;
82
79
  };
83
80
 
84
81
  } // End namespace SVF
@@ -76,7 +76,7 @@ public:
76
76
  virtual ~WPAPass();
77
77
 
78
78
  /// Interface expose to users of our pointer analysis, given Value infos
79
- virtual AliasResult alias(const Value* V1, const Value* V2);
79
+ virtual AliasResult alias(const SVFValue* V1, const SVFValue* V2);
80
80
 
81
81
  /// Print all alias pairs
82
82
  virtual void PrintAliasPairs(PointerAnalysis* pta);
@@ -85,19 +85,19 @@ public:
85
85
  virtual ModRefInfo getModRefInfo(const CallSite callInst);
86
86
 
87
87
  /// Interface of mod-ref analysis to determine whether a CallSite instruction can mod or ref a specific memory location, given Location infos
88
- virtual inline ModRefInfo getModRefInfo(const CallSite callInst, const MemoryLocation& Loc)
89
- {
90
- return getModRefInfo(callInst, Loc.Ptr);
91
- }
88
+ // virtual inline ModRefInfo getModRefInfo(const CallSite callInst, const MemoryLocation& Loc)
89
+ // {
90
+ // return getModRefInfo(callInst, Loc.Ptr);
91
+ // }
92
92
 
93
93
  /// Interface of mod-ref analysis to determine whether a CallSite instruction can mod or ref a specific memory location, given Value infos
94
- virtual ModRefInfo getModRefInfo(const CallSite callInst, const Value* V);
94
+ virtual ModRefInfo getModRefInfo(const CallSite callInst, const SVFValue* V);
95
95
 
96
96
  /// Interface of mod-ref analysis between two CallSite instructions
97
97
  virtual ModRefInfo getModRefInfo(const CallSite callInst1, const CallSite callInst2);
98
98
 
99
99
  /// Run pointer analysis on SVFModule
100
- virtual void runOnModule(SVFModule* svfModule);
100
+ virtual void runOnModule(SVFIR* svfModule);
101
101
 
102
102
  /// PTA name
103
103
  virtual inline std::string getPassName() const
@@ -107,7 +107,7 @@ public:
107
107
 
108
108
  private:
109
109
  /// Create pointer analysis according to specified kind and analyze the module.
110
- void runPointerAnalysis(SVFModule* svfModule, u32_t kind);
110
+ void runPointerAnalysis(SVFIR* pag, u32_t kind);
111
111
 
112
112
  PTAVector ptaVector; ///< all pointer analysis to be executed.
113
113
  PointerAnalysis* _pta; ///< pointer analysis to be executed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1289",
3
+ "version": "1.0.1291",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {