svf-lib 1.0.1823 → 1.0.1825

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 (69) hide show
  1. package/SVF-linux/svf/include/Util/WorkList.h +0 -0
  2. package/SVF-linux/svf-llvm/include/SVF-LLVM/{CPPUtil.h → CppUtil.h} +37 -12
  3. package/SVF-linux/svf-llvm/include/SVF-LLVM/DCHG.h +1 -9
  4. package/SVF-linux/svf-llvm/include/SVF-LLVM/ICFGBuilder.h +1 -0
  5. package/SVF-linux/svf-llvm/include/SVF-LLVM/LLVMModule.h +0 -1
  6. package/SVF-linux/svf-llvm/include/SVF-LLVM/LLVMUtil.h +4 -108
  7. package/package.json +1 -1
  8. package/SVF-linux/Release-build/svf/libSvfCore.a +0 -0
  9. package/SVF-linux/Release-build/svf-llvm/extapi.bc +0 -2433
  10. package/SVF-linux/Release-build/svf-llvm/libSvfLLVM.a +0 -0
  11. package/SVF-linux/svf/include/AbstractExecution/WTO.h +0 -897
  12. package/SVF-linux/svf/include/CFL/CFLData.h +0 -316
  13. package/SVF-linux/svf/include/CFL/CFLDataBuilder.h +0 -91
  14. package/SVF-linux/svf/include/CFL/CFLGrammar.h +0 -468
  15. package/SVF-linux/svf/include/CFL/CFLGrammar.txt +0 -15
  16. package/SVF-linux/svf/include/CFL/CFLGrammarDev.txt +0 -16
  17. package/SVF-linux/svf/include/CFL/PEGGrammar.txt +0 -11
  18. package/SVF-linux/svf/include/CFL/VFG.txt +0 -7
  19. package/SVF-linux/svf/include/CUDD/cudd.h +0 -688
  20. package/SVF-linux/svf/include/CUDD/cuddInt.h +0 -1145
  21. package/SVF-linux/svf/include/CUDD/epd.h +0 -192
  22. package/SVF-linux/svf/include/CUDD/mtr.h +0 -180
  23. package/SVF-linux/svf/include/CUDD/mtrInt.h +0 -92
  24. package/SVF-linux/svf/include/CUDD/st.h +0 -230
  25. package/SVF-linux/svf/include/CUDD/util.h +0 -196
  26. package/SVF-linux/svf/include/Graphs/ExternalPAG.h +0 -147
  27. package/SVF-linux/svf/include/Graphs/ICFGWrapper.h +0 -728
  28. package/SVF-linux/svf/include/Graphs/OfflineConsG.h +0 -151
  29. package/SVF-linux/svf/include/Graphs/PAG.h +0 -932
  30. package/SVF-linux/svf/include/Graphs/PAGEdge.h +0 -738
  31. package/SVF-linux/svf/include/Graphs/PAGNode.h +0 -843
  32. package/SVF-linux/svf/include/MTA/LockResultValidator.h +0 -118
  33. package/SVF-linux/svf/include/MTA/MTAAnnotator.h +0 -118
  34. package/SVF-linux/svf/include/MemoryModel/LocationSet.h +0 -157
  35. package/SVF-linux/svf/include/MemoryModel/MemModel.h +0 -414
  36. package/SVF-linux/svf/include/MemoryModel/PAGBuilderFromFile.h +0 -80
  37. package/SVF-linux/svf/include/MemoryModel/PTAStat.h +0 -174
  38. package/SVF-linux/svf/include/MemoryModel/PTAType.h +0 -368
  39. package/SVF-linux/svf/include/MemoryModel/PointsToDFDS.h +0 -514
  40. package/SVF-linux/svf/include/MemoryModel/PointsToDS.h +0 -289
  41. package/SVF-linux/svf/include/MemoryModel/SVFIR.h +0 -650
  42. package/SVF-linux/svf/include/MemoryModel/SVFStatements.h +0 -1101
  43. package/SVF-linux/svf/include/MemoryModel/SVFSymbols.h +0 -648
  44. package/SVF-linux/svf/include/MemoryModel/SVFVariables.h +0 -721
  45. package/SVF-linux/svf/include/MemoryModel/SymbolTableInfo.h +0 -713
  46. package/SVF-linux/svf/include/SABER/PathCondAllocator.h +0 -303
  47. package/SVF-linux/svf/include/SABER/SaberAnnotator.h +0 -72
  48. package/SVF-linux/svf/include/SVFIR/SVFIRRW.h +0 -1302
  49. package/SVF-linux/svf/include/SVFIR/SVFModuleRW.h +0 -197
  50. package/SVF-linux/svf/include/Util/BDDExpr.h +0 -198
  51. package/SVF-linux/svf/include/Util/BasicTypes.h +0 -768
  52. package/SVF-linux/svf/include/Util/CFLSolver.h +0 -186
  53. package/SVF-linux/svf/include/Util/Conditions.h +0 -421
  54. package/SVF-linux/svf/include/Util/CppUtil.h +0 -81
  55. package/SVF-linux/svf/include/Util/ExeState.h +0 -197
  56. package/SVF-linux/svf/include/Util/ExtAPI.json +0 -5853
  57. package/SVF-linux/svf/include/Util/IRAnnotator.h +0 -321
  58. package/SVF-linux/svf/include/Util/PathCondAllocator.h +0 -286
  59. package/SVF-linux/svf/include/Util/PathDPItem.h +0 -310
  60. package/SVF-linux/svf/include/Util/SCC.h +0 -354
  61. package/SVF-linux/svf/include/Util/SVFBasicTypes.h +0 -245
  62. package/SVF-linux/svf/include/Util/SVFInstruction.h +0 -40
  63. package/SVF-linux/svf/include/Util/SVFModule.h +0 -278
  64. package/SVF-linux/svf/include/Util/SymState.h +0 -118
  65. package/SVF-linux/svf/include/Util/TypeBasedHeapCloning.h +0 -188
  66. package/SVF-linux/svf/include/WPA/AndersenSFR.h +0 -160
  67. package/SVF-linux/svf/include/WPA/FlowSensitiveTBHC.h +0 -122
  68. package/SVF-linux/svf/include/WPA/TypeBasedHeapCloning.h +0 -188
  69. package/SVF-linux/svf-llvm/include/SVF-LLVM/IRAnnotator.h +0 -324
File without changes
@@ -6,16 +6,16 @@
6
6
  //
7
7
 
8
8
  // This program is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
9
+ // it under the terms of the GNU Affero General Public License as published by
10
10
  // the Free Software Foundation, either version 3 of the License, or
11
11
  // (at your option) any later version.
12
12
 
13
13
  // This program is distributed in the hope that it will be useful,
14
14
  // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
16
+ // GNU Affero General Public License for more details.
17
17
 
18
- // You should have received a copy of the GNU General Public License
18
+ // You should have received a copy of the GNU Affero General Public License
19
19
  // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  //
21
21
  //===----------------------------------------------------------------------===//
@@ -51,11 +51,35 @@ struct DemangledName
51
51
  bool isThunkFunc;
52
52
  };
53
53
 
54
- struct DemangledName demangle(const std::string &name);
54
+ struct DemangledName demangle(const std::string& name);
55
+
56
+ std::string getBeforeBrackets(const std::string& name);
57
+ std::string getClassNameFromVtblObj(const std::string& vtblName);
58
+
59
+ /*
60
+ * Get the vtable struct of a class.
61
+ *
62
+ * Given the class:
63
+ *
64
+ * class A {
65
+ * virtual ~A();
66
+ * };
67
+ * A::~A() = default;
68
+ *
69
+ * The corresponding vtable @_ZTV1A is of type:
70
+ *
71
+ * { [4 x i8*] }
72
+ *
73
+ * If the program has been compiled with AddressSanitizer,
74
+ * the vtable will have redzones and appear as:
75
+ *
76
+ * { { [4 x i8*] }, [32 x i8] }
77
+ *
78
+ * See https://github.com/SVF-tools/SVF/issues/1114 for more.
79
+ */
80
+ const ConstantStruct *getVtblStruct(const GlobalValue *vtbl);
55
81
 
56
- std::string getBeforeBrackets(const std::string &name);
57
82
  bool isValVtbl(const Value* val);
58
- bool isLoadVtblInst(const LoadInst *loadInst);
59
83
  bool isVirtualCallSite(const CallBase* cs);
60
84
  bool isConstructor(const Function* F);
61
85
  bool isDestructor(const Function* F);
@@ -87,8 +111,8 @@ const Argument* getConstructorThisPtr(const Function* fun);
87
111
  const Value* getVCallThisPtr(const CallBase* cs);
88
112
  const Value* getVCallVtblPtr(const CallBase* cs);
89
113
  s32_t getVCallIdx(const CallBase* cs);
90
- std::string getClassNameFromVtblObj(const std::string& vtblName);
91
- std::string getClassNameFromType(const Type* ty);
114
+ bool classTyHasVTable(const StructType* ty);
115
+ std::string getClassNameFromType(const StructType* ty);
92
116
  std::string getClassNameOfThisPtr(const CallBase* cs);
93
117
  std::string getFunNameOfVCallSite(const CallBase* cs);
94
118
  bool VCallInCtorOrDtor(const CallBase* cs);
@@ -102,7 +126,8 @@ bool VCallInCtorOrDtor(const CallBase* cs);
102
126
  * }
103
127
  * this and this1 are the same thisPtr in the constructor
104
128
  */
105
- bool isSameThisPtrInConstructor(const Argument* thisPtr1, const Value* thisPtr2);
129
+ bool isSameThisPtrInConstructor(const Argument* thisPtr1,
130
+ const Value* thisPtr2);
106
131
 
107
132
  /// Constants pertaining to CTir, for C and C++.
108
133
  /// TODO: move helper functions here too?
@@ -111,17 +136,17 @@ namespace ctir
111
136
  /// On loads, stores, GEPs representing dereferences, and calls
112
137
  /// representing virtual calls.
113
138
  /// (The static type.)
114
- const std::string derefMDName = "ctir";
139
+ const std::string derefMDName = "ctir";
115
140
  /// On the (global) virtual table itself.
116
141
  /// (The class it corresponds to.)
117
- const std::string vtMDName = "ctir.vt";
142
+ const std::string vtMDName = "ctir.vt";
118
143
  /// On the bitcast of `this` to i8*.
119
144
  /// (The class the constructor it corresponds to.)
120
145
  const std::string vtInitMDName = "ctir.vt.init";
121
146
 
122
147
  /// Value we expect a ctir-annotated module to have.
123
148
  const uint32_t moduleFlagValue = 1;
124
- }
149
+ } // namespace ctir
125
150
 
126
151
  } // End namespace cppUtil
127
152
 
@@ -16,7 +16,6 @@
16
16
 
17
17
  #include "Graphs/GenericGraph.h"
18
18
  #include "Graphs/CHG.h"
19
- #include "Util/CppUtil.h"
20
19
  #include "SVF-LLVM/BasicTypes.h"
21
20
  #include "SVFIR/SVFModule.h"
22
21
  #include "Util/SVFUtil.h"
@@ -413,14 +412,7 @@ private:
413
412
  DCHNode* getOrCreateNode(const DIType* type);
414
413
 
415
414
  /// Retrieves the metadata associated with a *virtual* callsite.
416
- const DIType* getCSStaticType(CallBase* cs) const
417
- {
418
- MDNode *md = cs->getMetadata(cppUtil::ctir::derefMDName);
419
- assert(md != nullptr && "Missing type metadata at virtual callsite");
420
- DIType *diType = SVFUtil::dyn_cast<DIType>(md);
421
- assert(diType != nullptr && "Incorrect metadata type at virtual callsite");
422
- return diType;
423
- }
415
+ const DIType* getCSStaticType(CallBase* cs) const;
424
416
 
425
417
  const DIType *getCSStaticType(CallSite cs) const
426
418
  {
@@ -32,6 +32,7 @@
32
32
 
33
33
  #include "Graphs/ICFG.h"
34
34
  #include "Util/WorkList.h"
35
+ #include "BasicTypes.h"
35
36
 
36
37
  namespace SVF
37
38
  {
@@ -31,7 +31,6 @@
31
31
  #define INCLUDE_SVF_FE_LLVMMODULE_H_
32
32
 
33
33
  #include "SVF-LLVM/BasicTypes.h"
34
- #include "Util/CppUtil.h"
35
34
  #include "SVFIR/SVFValue.h"
36
35
  #include "SVFIR/SVFModule.h"
37
36
  #include "Util/Options.h"
@@ -32,7 +32,6 @@
32
32
 
33
33
  #include "Util/SVFUtil.h"
34
34
  #include "SVF-LLVM/BasicTypes.h"
35
- #include "SVF-LLVM/LLVMModule.h"
36
35
  #include "SVFIR/SVFValue.h"
37
36
  #include "Util/ThreadAPI.h"
38
37
 
@@ -54,15 +53,7 @@ inline bool isCallSite(const Value* val)
54
53
  }
55
54
 
56
55
  /// Get the definition of a function across multiple modules
57
- inline const Function* getDefFunForMultipleModule(const Function* fun)
58
- {
59
- if (fun == nullptr)
60
- return nullptr;
61
- LLVMModuleSet* llvmModuleset = LLVMModuleSet::getLLVMModuleSet();
62
- if (fun->isDeclaration() && llvmModuleset->hasDefinition(fun))
63
- fun = LLVMModuleSet::getLLVMModuleSet()->getDefinition(fun);
64
- return fun;
65
- }
56
+ const Function* getDefFunForMultipleModule(const Function* fun);
66
57
 
67
58
  /// Return LLVM callsite given a value
68
59
  inline const CallBase* getLLVMCallSite(const Value* value)
@@ -85,18 +76,7 @@ inline const Function* getLLVMFunction(const Value* val)
85
76
  }
86
77
 
87
78
  /// Get program entry function from module.
88
- inline const Function* getProgFunction(const std::string& funName)
89
- {
90
- for (const Module& M : LLVMModuleSet::getLLVMModuleSet()->getLLVMModules())
91
- {
92
- for (const Function& fun : M)
93
- {
94
- if (fun.getName() == funName)
95
- return &fun;
96
- }
97
- }
98
- return nullptr;
99
- }
79
+ const Function* getProgFunction(const std::string& funName);
100
80
 
101
81
  /// Check whether a function is an entry function (i.e., main)
102
82
  inline bool isProgEntryFunction(const Function* fun)
@@ -354,10 +334,7 @@ void removeUnusedGlobalVariables(Module* module);
354
334
  void removeUnusedFuncsAndAnnotationsAndGlobalVariables(std::vector<Function*> removedFuncList);
355
335
 
356
336
  /// Get the corresponding Function based on its name
357
- inline const SVFFunction* getFunction(const std::string& name)
358
- {
359
- return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(name);
360
- }
337
+ const SVFFunction* getFunction(const std::string& name);
361
338
 
362
339
  /// Return true if the value refers to constant data, e.g., i32 0
363
340
  inline bool isConstDataOrAggData(const Value* val)
@@ -367,15 +344,7 @@ inline bool isConstDataOrAggData(const Value* val)
367
344
  }
368
345
 
369
346
  /// find the unique defined global across multiple modules
370
- inline const Value* getGlobalRep(const Value* val)
371
- {
372
- if (const GlobalVariable* gvar = SVFUtil::dyn_cast<GlobalVariable>(val))
373
- {
374
- if (LLVMModuleSet::getLLVMModuleSet()->hasGlobalRep(gvar))
375
- val = LLVMModuleSet::getLLVMModuleSet()->getGlobalRep(gvar);
376
- }
377
- return val;
378
- }
347
+ const Value* getGlobalRep(const Value* val);
379
348
 
380
349
  /// Check whether this value points-to a constant object
381
350
  bool isConstantObjSym(const SVFValue* val);
@@ -389,79 +358,6 @@ void viewCFG(const Function* fun);
389
358
  // Dump Control Flow Graph of llvm function, without instructions
390
359
  void viewCFGOnly(const Function* fun);
391
360
 
392
- /*
393
- * Get the vtable struct of a class.
394
- *
395
- * Given the class:
396
- *
397
- * class A {
398
- * virtual ~A();
399
- * };
400
- * A::~A() = default;
401
- *
402
- * The corresponding vtable @_ZTV1A is of type:
403
- *
404
- * { [4 x i8*] }
405
- *
406
- * If the program has been compiled with AddressSanitizer,
407
- * the vtable will have redzones and appear as:
408
- *
409
- * { { [4 x i8*] }, [32 x i8] }
410
- *
411
- * See https://github.com/SVF-tools/SVF/issues/1114 for more.
412
- */
413
- const ConstantStruct *getVtblStruct(const GlobalValue *vtbl);
414
-
415
- bool isValVtbl(const Value* val);
416
- bool isVirtualCallSite(const CallBase* cs);
417
- bool isConstructor(const Function* F);
418
- bool isDestructor(const Function* F);
419
- bool isCPPThunkFunction(const Function* F);
420
- const Function* getThunkTarget(const Function* F);
421
-
422
- /*
423
- * VtableA = {&A::foo}
424
- * A::A(this){
425
- * *this = &VtableA;
426
- * }
427
- *
428
- *
429
- * A* p = new A;
430
- * cs: p->foo(...)
431
- * ==>
432
- * vtptr = *p;
433
- * vfn = &vtptr[i]
434
- * %funp = *vfn
435
- * call %funp(p,...)
436
- * getConstructorThisPtr(A) return "this" pointer
437
- * getVCallThisPtr(cs) return p (this pointer)
438
- * getVCallVtblPtr(cs) return vtptr
439
- * getVCallIdx(cs) return i
440
- * getClassNameFromVtblObj(VtableA) return
441
- * getClassNameFromType(type of p) return type A
442
- */
443
- const Argument* getConstructorThisPtr(const Function* fun);
444
- const Value* getVCallThisPtr(const CallBase* cs);
445
- const Value* getVCallVtblPtr(const CallBase* cs);
446
- s32_t getVCallIdx(const CallBase* cs);
447
- bool classTyHasVTable(const StructType* ty);
448
- std::string getClassNameFromType(const StructType* ty);
449
- std::string getClassNameOfThisPtr(const CallBase* cs);
450
- std::string getFunNameOfVCallSite(const CallBase* cs);
451
- bool VCallInCtorOrDtor(const CallBase* cs);
452
-
453
- /*
454
- * A(A* this){
455
- * store this this.addr;
456
- * tmp = load this.addr;
457
- * this1 = bitcast(tmp);
458
- * B(this1);
459
- * }
460
- * this and this1 are the same thisPtr in the constructor
461
- */
462
- bool isSameThisPtrInConstructor(const Argument* thisPtr1,
463
- const Value* thisPtr2);
464
-
465
361
  std::string dumpValue(const Value* val);
466
362
 
467
363
  std::string dumpType(const Type* type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1823",
3
+ "version": "1.0.1825",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {