svf-lib 1.0.2211 → 1.0.2213

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 (96) hide show
  1. package/SVF-linux/Release-build/bin/ae +0 -0
  2. package/SVF-linux/Release-build/bin/cfl +0 -0
  3. package/SVF-linux/Release-build/bin/dvf +0 -0
  4. package/SVF-linux/Release-build/bin/llvm2svf +0 -0
  5. package/SVF-linux/Release-build/bin/mta +0 -0
  6. package/SVF-linux/Release-build/bin/saber +0 -0
  7. package/SVF-linux/Release-build/bin/svf-ex +0 -0
  8. package/SVF-linux/Release-build/bin/wpa +0 -0
  9. package/SVF-linux/Release-build/include/AE/Svfexe/AbstractInterpretation.h +2 -2
  10. package/SVF-linux/Release-build/include/CFL/CFLAlias.h +1 -1
  11. package/SVF-linux/Release-build/include/DDA/ContextDDA.h +6 -6
  12. package/SVF-linux/Release-build/include/DDA/DDAVFSolver.h +2 -2
  13. package/SVF-linux/Release-build/include/DDA/FlowDDA.h +2 -2
  14. package/SVF-linux/Release-build/include/Graphs/BasicBlockG.h +17 -9
  15. package/SVF-linux/Release-build/include/Graphs/CHG.h +7 -7
  16. package/SVF-linux/Release-build/include/Graphs/CallGraph.h +23 -27
  17. package/SVF-linux/Release-build/include/Graphs/ConsG.h +2 -2
  18. package/SVF-linux/Release-build/include/Graphs/ICFG.h +11 -11
  19. package/SVF-linux/Release-build/include/Graphs/ICFGNode.h +12 -18
  20. package/SVF-linux/Release-build/include/Graphs/IRGraph.h +11 -9
  21. package/SVF-linux/Release-build/include/Graphs/SVFG.h +13 -13
  22. package/SVF-linux/Release-build/include/Graphs/SVFGNode.h +2 -2
  23. package/SVF-linux/Release-build/include/Graphs/ThreadCallGraph.h +3 -21
  24. package/SVF-linux/Release-build/include/Graphs/VFG.h +15 -15
  25. package/SVF-linux/Release-build/include/Graphs/VFGNode.h +10 -10
  26. package/SVF-linux/Release-build/include/MSSA/MSSAMuChi.h +6 -6
  27. package/SVF-linux/Release-build/include/MSSA/MemPartition.h +12 -12
  28. package/SVF-linux/Release-build/include/MSSA/MemRegion.h +21 -21
  29. package/SVF-linux/Release-build/include/MSSA/MemSSA.h +10 -10
  30. package/SVF-linux/Release-build/include/MTA/LockAnalysis.h +4 -4
  31. package/SVF-linux/Release-build/include/MTA/MHP.h +8 -8
  32. package/SVF-linux/Release-build/include/MTA/TCT.h +10 -10
  33. package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h +4 -4
  34. package/SVF-linux/Release-build/include/SABER/DoubleFreeChecker.h +2 -2
  35. package/SVF-linux/Release-build/include/SABER/FileChecker.h +2 -2
  36. package/SVF-linux/Release-build/include/SABER/LeakChecker.h +4 -4
  37. package/SVF-linux/Release-build/include/SABER/SaberCheckerAPI.h +6 -5
  38. package/SVF-linux/Release-build/include/SABER/SaberCondAllocator.h +5 -5
  39. package/SVF-linux/Release-build/include/SABER/SrcSnkDDA.h +2 -2
  40. package/SVF-linux/Release-build/include/SVF-LLVM/LLVMModule.h +83 -7
  41. package/SVF-linux/Release-build/include/SVF-LLVM/LLVMUtil.h +9 -1
  42. package/SVF-linux/Release-build/include/SVF-LLVM/SVFIRBuilder.h +5 -2
  43. package/SVF-linux/Release-build/include/SVFIR/SVFIR.h +20 -27
  44. package/SVF-linux/Release-build/include/SVFIR/SVFValue.h +3 -2
  45. package/SVF-linux/Release-build/include/SVFIR/SVFVariables.h +271 -71
  46. package/SVF-linux/Release-build/include/Util/CDGBuilder.h +1 -1
  47. package/SVF-linux/Release-build/include/Util/CallGraphBuilder.h +1 -1
  48. package/SVF-linux/Release-build/include/Util/CxtStmt.h +6 -6
  49. package/SVF-linux/Release-build/include/Util/ExtAPI.h +20 -16
  50. package/SVF-linux/Release-build/include/Util/SVFUtil.h +16 -30
  51. package/SVF-linux/Release-build/include/Util/ThreadAPI.h +2 -11
  52. package/SVF-linux/Release-build/include/WPA/Andersen.h +2 -2
  53. package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
  54. package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
  55. package/SVF-osx/Release-build/bin/ae +0 -0
  56. package/SVF-osx/Release-build/bin/cfl +0 -0
  57. package/SVF-osx/Release-build/bin/dvf +0 -0
  58. package/SVF-osx/Release-build/bin/llvm2svf +0 -0
  59. package/SVF-osx/Release-build/bin/mta +0 -0
  60. package/SVF-osx/Release-build/bin/saber +0 -0
  61. package/SVF-osx/Release-build/bin/svf-ex +0 -0
  62. package/SVF-osx/Release-build/bin/wpa +0 -0
  63. package/SVF-osx/Release-build/include/DDA/DDAClient.h +6 -11
  64. package/SVF-osx/Release-build/include/DDA/DDAPass.h +1 -1
  65. package/SVF-osx/Release-build/include/Graphs/CHG.h +2 -3
  66. package/SVF-osx/Release-build/include/Graphs/GenericGraph.h +1 -286
  67. package/SVF-osx/Release-build/include/MTA/MTA.h +2 -2
  68. package/SVF-osx/Release-build/include/MTA/TCT.h +0 -6
  69. package/SVF-osx/Release-build/include/MemoryModel/PointerAnalysis.h +1 -7
  70. package/SVF-osx/Release-build/include/SABER/DoubleFreeChecker.h +1 -1
  71. package/SVF-osx/Release-build/include/SABER/FileChecker.h +1 -1
  72. package/SVF-osx/Release-build/include/SABER/LeakChecker.h +1 -1
  73. package/SVF-osx/Release-build/include/SABER/SaberCondAllocator.h +1 -2
  74. package/SVF-osx/Release-build/include/SABER/SrcSnkDDA.h +2 -2
  75. package/SVF-osx/Release-build/include/SVF-LLVM/BreakConstantExpr.h +1 -1
  76. package/SVF-osx/Release-build/include/SVF-LLVM/CppUtil.h +1 -1
  77. package/SVF-osx/Release-build/include/SVF-LLVM/DCHG.h +1 -1
  78. package/SVF-osx/Release-build/include/SVF-LLVM/LLVMLoopAnalysis.h +1 -1
  79. package/SVF-osx/Release-build/include/SVF-LLVM/LLVMModule.h +2 -2
  80. package/SVF-osx/Release-build/include/SVF-LLVM/LLVMUtil.h +1 -1
  81. package/SVF-osx/Release-build/include/SVF-LLVM/ObjTypeInference.h +1 -1
  82. package/SVF-osx/Release-build/include/{SVFIR → SVF-LLVM}/SVFModule.h +1 -36
  83. package/SVF-osx/Release-build/include/SVF-LLVM/SVFValue.h +805 -0
  84. package/SVF-osx/Release-build/include/SVFIR/ObjTypeInfo.h +0 -1
  85. package/SVF-osx/Release-build/include/SVFIR/SVFIR.h +38 -11
  86. package/SVF-osx/Release-build/include/SVFIR/SVFStatements.h +1 -0
  87. package/SVF-osx/Release-build/include/SVFIR/SVFValue.h +202 -799
  88. package/SVF-osx/Release-build/include/Util/CDGBuilder.h +1 -1
  89. package/SVF-osx/Release-build/include/Util/GeneralType.h +1 -0
  90. package/SVF-osx/Release-build/include/Util/SVFLoopAndDomInfo.h +169 -0
  91. package/SVF-osx/Release-build/include/Util/SVFUtil.h +3 -1
  92. package/SVF-osx/Release-build/include/Util/ThreadAPI.h +2 -1
  93. package/SVF-osx/Release-build/include/WPA/FlowSensitive.h +1 -1
  94. package/SVF-osx/Release-build/lib/libSvfCore.a +0 -0
  95. package/SVF-osx/Release-build/lib/libSvfLLVM.a +0 -0
  96. package/package.json +1 -1
@@ -55,7 +55,7 @@ public:
55
55
  void build();
56
56
 
57
57
  /// build control dependence for each function
58
- void buildControlDependence(const SVFModule *svfgModule);
58
+ void buildControlDependence();
59
59
 
60
60
  /// build map at icfg node level
61
61
  void buildICFGNodeControlMap();
@@ -38,6 +38,7 @@
38
38
  #include <unordered_map>
39
39
  #include <unordered_set>
40
40
  #include <vector>
41
+ #include <memory>
41
42
  #include "Util/SparseBitVector.h"
42
43
 
43
44
  namespace SVF
@@ -0,0 +1,169 @@
1
+ //===- SVFLoopAndDomInfo.h -- ------------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-2017> <Yulei Sui>
6
+ //
7
+
8
+ // This program is free software: you can redistribute it and/or modify
9
+ // it under the terms of the GNU Affero General Public License as published by
10
+ // the Free Software Foundation, either version 3 of the License, or
11
+ // (at your option) any later version.
12
+
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU Affero General Public License for more details.
17
+
18
+ // You should have received a copy of the GNU Affero General Public License
19
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ //
21
+ //===----------------------------------------------------------------------===//
22
+
23
+ /*
24
+ * SVFLoopAndDomInfo.h
25
+ *
26
+ * Created on: Feb 7, 2025
27
+ * Author: Xiao Cheng
28
+ *
29
+ */
30
+
31
+ #ifndef SVFLOOPANDDOMINFO_H
32
+ #define SVFLOOPANDDOMINFO_H
33
+
34
+ #include "SVFIR/SVFType.h"
35
+ #include "Graphs/GraphPrinter.h"
36
+ #include "Util/Casting.h"
37
+ #include "Graphs/BasicBlockG.h"
38
+
39
+ namespace SVF
40
+ {
41
+ class SVFLoopAndDomInfo
42
+ {
43
+ friend class SVFIRWriter;
44
+ friend class SVFIRReader;
45
+ public:
46
+ typedef Set<const SVFBasicBlock*> BBSet;
47
+ typedef std::vector<const SVFBasicBlock*> BBList;
48
+ typedef BBList LoopBBs;
49
+
50
+ private:
51
+ BBList reachableBBs; ///< reachable BasicBlocks from the function entry.
52
+ Map<const SVFBasicBlock*,BBSet> dtBBsMap; ///< map a BasicBlock to BasicBlocks it Dominates
53
+ Map<const SVFBasicBlock*,BBSet> pdtBBsMap; ///< map a BasicBlock to BasicBlocks it PostDominates
54
+ Map<const SVFBasicBlock*,BBSet> dfBBsMap; ///< map a BasicBlock to its Dominate Frontier BasicBlocks
55
+ Map<const SVFBasicBlock*, LoopBBs> bb2LoopMap; ///< map a BasicBlock (if it is in a loop) to all the BasicBlocks in this loop
56
+ Map<const SVFBasicBlock*, u32_t> bb2PdomLevel; ///< map a BasicBlock to its level in pdom tree, used in findNearestCommonPDominator
57
+ Map<const SVFBasicBlock*, const SVFBasicBlock*> bb2PIdom; ///< map a BasicBlock to its immediate dominator in pdom tree, used in findNearestCommonPDominator
58
+
59
+ public:
60
+ SVFLoopAndDomInfo()
61
+ {
62
+ }
63
+
64
+ virtual ~SVFLoopAndDomInfo() {}
65
+
66
+ inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
67
+ {
68
+ return dfBBsMap;
69
+ }
70
+
71
+ inline Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap()
72
+ {
73
+ return dfBBsMap;
74
+ }
75
+
76
+ inline bool hasLoopInfo(const SVFBasicBlock* bb) const
77
+ {
78
+ return bb2LoopMap.find(bb) != bb2LoopMap.end();
79
+ }
80
+
81
+ const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const;
82
+
83
+ inline const SVFBasicBlock* getLoopHeader(const LoopBBs& lp) const
84
+ {
85
+ assert(!lp.empty() && "this is not a loop, empty basic block");
86
+ return lp.front();
87
+ }
88
+
89
+ inline bool loopContainsBB(const LoopBBs& lp, const SVFBasicBlock* bb) const
90
+ {
91
+ return std::find(lp.begin(), lp.end(), bb) != lp.end();
92
+ }
93
+
94
+ inline void addToBB2LoopMap(const SVFBasicBlock* bb, const SVFBasicBlock* loopBB)
95
+ {
96
+ bb2LoopMap[bb].push_back(loopBB);
97
+ }
98
+
99
+ inline const Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap() const
100
+ {
101
+ return pdtBBsMap;
102
+ }
103
+
104
+ inline Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap()
105
+ {
106
+ return pdtBBsMap;
107
+ }
108
+
109
+ inline const Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel() const
110
+ {
111
+ return bb2PdomLevel;
112
+ }
113
+
114
+ inline Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel()
115
+ {
116
+ return bb2PdomLevel;
117
+ }
118
+
119
+ inline const Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom() const
120
+ {
121
+ return bb2PIdom;
122
+ }
123
+
124
+ inline Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom()
125
+ {
126
+ return bb2PIdom;
127
+ }
128
+
129
+
130
+ inline Map<const SVFBasicBlock*,BBSet>& getDomTreeMap()
131
+ {
132
+ return dtBBsMap;
133
+ }
134
+
135
+ inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
136
+ {
137
+ return dtBBsMap;
138
+ }
139
+
140
+ inline bool isUnreachable(const SVFBasicBlock* bb) const
141
+ {
142
+ return std::find(reachableBBs.begin(), reachableBBs.end(), bb) ==
143
+ reachableBBs.end();
144
+ }
145
+
146
+ inline const BBList& getReachableBBs() const
147
+ {
148
+ return reachableBBs;
149
+ }
150
+
151
+ inline void setReachableBBs(BBList& bbs)
152
+ {
153
+ reachableBBs = bbs;
154
+ }
155
+
156
+ void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const;
157
+
158
+ bool isLoopHeader(const SVFBasicBlock* bb) const;
159
+
160
+ bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const;
161
+
162
+ bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const;
163
+
164
+ /// find nearest common post dominator of two basic blocks
165
+ const SVFBasicBlock *findNearestCommonPDominator(const SVFBasicBlock *A, const SVFBasicBlock *B) const;
166
+ };
167
+ }
168
+
169
+ #endif //SVFLOOPANDDOMINFO_H
@@ -32,10 +32,12 @@
32
32
 
33
33
  #include "FastCluster/fastcluster.h"
34
34
  #include "SVFIR/SVFValue.h"
35
- #include "SVFIR/SVFModule.h"
35
+ #include "Util/SVFLoopAndDomInfo.h"
36
36
  #include "Util/ExtAPI.h"
37
37
  #include "MemoryModel/PointsTo.h"
38
38
  #include <time.h>
39
+ #include "Util/NodeIDAllocator.h"
40
+ #include "Util/ThreadAPI.h"
39
41
 
40
42
  namespace SVF
41
43
  {
@@ -41,6 +41,7 @@ class CallICFGNode;
41
41
  class SVFVar;
42
42
  class ValVar;
43
43
  class ObjVar;
44
+ class FunObjVar;
44
45
 
45
46
  /*
46
47
  * ThreadAPI class contains interfaces for pthread programs
@@ -179,7 +180,7 @@ public:
179
180
  bool isTDBarWait(const CallICFGNode *inst) const;
180
181
  //@}
181
182
 
182
- void performAPIStat(SVFModule* m);
183
+ void performAPIStat();
183
184
  void statInit(Map<std::string, u32_t>& tdAPIStatMap);
184
185
  };
185
186
 
@@ -93,7 +93,7 @@ public:
93
93
  }
94
94
 
95
95
  /// We start from here
96
- virtual bool runOnModule(SVFModule*)
96
+ virtual bool runOnModule()
97
97
  {
98
98
  return false;
99
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2211",
3
+ "version": "1.0.2213",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {