svf-lib 1.0.1375 → 1.0.1376

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 (147) hide show
  1. package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
  2. package/SVF-osx/svf/include/include/AbstractExecution/AbstractValue.h +79 -0
  3. package/SVF-osx/svf/include/include/AbstractExecution/AddressValue.h +210 -0
  4. package/SVF-osx/svf/include/include/AbstractExecution/ExeState.h +223 -0
  5. package/SVF-osx/svf/include/include/AbstractExecution/IntervalExeState.h +425 -0
  6. package/SVF-osx/svf/include/include/AbstractExecution/IntervalValue.h +868 -0
  7. package/SVF-osx/svf/include/include/AbstractExecution/NumericLiteral.h +406 -0
  8. package/SVF-osx/svf/include/include/AbstractExecution/RelExeState.h +225 -0
  9. package/SVF-osx/svf/include/include/AbstractExecution/RelationSolver.h +68 -0
  10. package/SVF-osx/svf/include/include/AbstractExecution/SVFIR2ItvExeState.h +186 -0
  11. package/SVF-osx/svf/include/include/AbstractExecution/WTO.h +845 -0
  12. package/SVF-osx/svf/include/include/CFL/CFGNormalizer.h +84 -0
  13. package/SVF-osx/svf/include/include/CFL/CFLAlias.h +176 -0
  14. package/SVF-osx/svf/include/include/CFL/CFLBase.h +115 -0
  15. package/SVF-osx/svf/include/include/CFL/CFLData.h +316 -0
  16. package/SVF-osx/svf/include/include/CFL/CFLDataBuilder.h +91 -0
  17. package/SVF-osx/svf/include/include/CFL/CFLGramGraphChecker.h +74 -0
  18. package/SVF-osx/svf/include/include/CFL/CFLGrammar.h +468 -0
  19. package/SVF-osx/svf/include/include/CFL/CFLGrammar.txt +15 -0
  20. package/SVF-osx/svf/include/include/CFL/CFLGraphBuilder.h +193 -0
  21. package/SVF-osx/svf/include/include/CFL/CFLSolver.h +136 -0
  22. package/SVF-osx/svf/include/include/CFL/CFLStat.h +67 -0
  23. package/SVF-osx/svf/include/include/CFL/CFLVF.h +65 -0
  24. package/SVF-osx/svf/include/include/CFL/GrammarBuilder.h +100 -0
  25. package/SVF-osx/svf/include/include/CFL/PEGGrammar.txt +11 -0
  26. package/SVF-osx/svf/include/include/CFL/VFG.txt +7 -0
  27. package/SVF-osx/svf/include/include/DDA/ContextDDA.h +230 -0
  28. package/SVF-osx/svf/include/include/DDA/DDAClient.h +168 -0
  29. package/SVF-osx/svf/include/include/DDA/DDAPass.h +99 -0
  30. package/SVF-osx/svf/include/include/DDA/DDAStat.h +138 -0
  31. package/SVF-osx/svf/include/include/DDA/DDAVFSolver.h +789 -0
  32. package/SVF-osx/svf/include/include/DDA/FlowDDA.h +178 -0
  33. package/SVF-osx/svf/include/include/FastCluster/LICENSE.TXT +13 -0
  34. package/SVF-osx/svf/include/include/FastCluster/fastcluster.h +80 -0
  35. package/SVF-osx/svf/include/include/Graphs/CFLGraph.h +215 -0
  36. package/SVF-osx/svf/include/include/Graphs/CHG.h +351 -0
  37. package/SVF-osx/svf/include/include/Graphs/ConsG.h +408 -0
  38. package/SVF-osx/svf/include/include/Graphs/ConsGEdge.h +353 -0
  39. package/SVF-osx/svf/include/include/Graphs/ConsGNode.h +391 -0
  40. package/SVF-osx/svf/include/include/Graphs/DOTGraphTraits.h +188 -0
  41. package/SVF-osx/svf/include/include/Graphs/GenericGraph.h +620 -0
  42. package/SVF-osx/svf/include/include/Graphs/GraphPrinter.h +111 -0
  43. package/SVF-osx/svf/include/include/Graphs/GraphTraits.h +150 -0
  44. package/SVF-osx/svf/include/include/Graphs/GraphWriter.h +380 -0
  45. package/SVF-osx/svf/include/include/Graphs/ICFG.h +331 -0
  46. package/SVF-osx/svf/include/include/Graphs/ICFGEdge.h +264 -0
  47. package/SVF-osx/svf/include/include/Graphs/ICFGNode.h +523 -0
  48. package/SVF-osx/svf/include/include/Graphs/ICFGStat.h +164 -0
  49. package/SVF-osx/svf/include/include/Graphs/IRGraph.h +243 -0
  50. package/SVF-osx/svf/include/include/Graphs/PTACallGraph.h +471 -0
  51. package/SVF-osx/svf/include/include/Graphs/SVFG.h +490 -0
  52. package/SVF-osx/svf/include/include/Graphs/SVFGEdge.h +237 -0
  53. package/SVF-osx/svf/include/include/Graphs/SVFGNode.h +513 -0
  54. package/SVF-osx/svf/include/include/Graphs/SVFGOPT.h +362 -0
  55. package/SVF-osx/svf/include/include/Graphs/SVFGStat.h +273 -0
  56. package/SVF-osx/svf/include/include/Graphs/ThreadCallGraph.h +422 -0
  57. package/SVF-osx/svf/include/include/Graphs/VFG.h +664 -0
  58. package/SVF-osx/svf/include/include/Graphs/VFGEdge.h +295 -0
  59. package/SVF-osx/svf/include/include/Graphs/VFGNode.h +1197 -0
  60. package/SVF-osx/svf/include/include/MSSA/MSSAMuChi.h +722 -0
  61. package/SVF-osx/svf/include/include/MSSA/MemPartition.h +169 -0
  62. package/SVF-osx/svf/include/include/MSSA/MemRegion.h +491 -0
  63. package/SVF-osx/svf/include/include/MSSA/MemSSA.h +452 -0
  64. package/SVF-osx/svf/include/include/MSSA/SVFGBuilder.h +98 -0
  65. package/SVF-osx/svf/include/include/MTA/FSMPTA.h +270 -0
  66. package/SVF-osx/svf/include/include/MTA/LockAnalysis.h +517 -0
  67. package/SVF-osx/svf/include/include/MTA/MHP.h +565 -0
  68. package/SVF-osx/svf/include/include/MTA/MTA.h +101 -0
  69. package/SVF-osx/svf/include/include/MTA/MTAResultValidator.h +448 -0
  70. package/SVF-osx/svf/include/include/MTA/MTAStat.h +74 -0
  71. package/SVF-osx/svf/include/include/MTA/PCG.h +229 -0
  72. package/SVF-osx/svf/include/include/MTA/TCT.h +599 -0
  73. package/SVF-osx/svf/include/include/MemoryModel/AbstractPointsToDS.h +316 -0
  74. package/SVF-osx/svf/include/include/MemoryModel/ConditionalPT.h +878 -0
  75. package/SVF-osx/svf/include/include/MemoryModel/LocationSet.h +148 -0
  76. package/SVF-osx/svf/include/include/MemoryModel/MutablePointsToDS.h +1025 -0
  77. package/SVF-osx/svf/include/include/MemoryModel/PersistentPointsToCache.h +463 -0
  78. package/SVF-osx/svf/include/include/MemoryModel/PersistentPointsToDS.h +955 -0
  79. package/SVF-osx/svf/include/include/MemoryModel/PointerAnalysis.h +452 -0
  80. package/SVF-osx/svf/include/include/MemoryModel/PointerAnalysisImpl.h +590 -0
  81. package/SVF-osx/svf/include/include/MemoryModel/PointsTo.h +255 -0
  82. package/SVF-osx/svf/include/include/MemoryModel/SVFLoop.h +164 -0
  83. package/SVF-osx/svf/include/include/SABER/DoubleFreeChecker.h +76 -0
  84. package/SVF-osx/svf/include/include/SABER/FileChecker.h +82 -0
  85. package/SVF-osx/svf/include/include/SABER/LeakChecker.h +124 -0
  86. package/SVF-osx/svf/include/include/SABER/ProgSlice.h +313 -0
  87. package/SVF-osx/svf/include/include/SABER/SaberCheckerAPI.h +166 -0
  88. package/SVF-osx/svf/include/include/SABER/SaberCondAllocator.h +310 -0
  89. package/SVF-osx/svf/include/include/SABER/SaberSVFGBuilder.h +104 -0
  90. package/SVF-osx/svf/include/include/SABER/SrcSnkDDA.h +321 -0
  91. package/SVF-osx/svf/include/include/SABER/SrcSnkSolver.h +186 -0
  92. package/SVF-osx/svf/include/include/SVFIR/PAGBuilderFromFile.h +80 -0
  93. package/SVF-osx/svf/include/include/SVFIR/SVFIR.h +659 -0
  94. package/SVF-osx/svf/include/include/SVFIR/SVFModule.h +233 -0
  95. package/SVF-osx/svf/include/include/SVFIR/SVFStatements.h +1136 -0
  96. package/SVF-osx/svf/include/include/SVFIR/SVFType.h +527 -0
  97. package/SVF-osx/svf/include/include/SVFIR/SVFValue.h +1120 -0
  98. package/SVF-osx/svf/include/include/SVFIR/SVFVariables.h +721 -0
  99. package/SVF-osx/svf/include/include/SVFIR/SymbolTableInfo.h +597 -0
  100. package/SVF-osx/svf/include/include/Util/Annotator.h +180 -0
  101. package/SVF-osx/svf/include/include/Util/BitVector.h +55 -0
  102. package/SVF-osx/svf/include/include/Util/CallGraphBuilder.h +74 -0
  103. package/SVF-osx/svf/include/include/Util/Casting.h +426 -0
  104. package/SVF-osx/svf/include/include/Util/CommandLine.h +530 -0
  105. package/SVF-osx/svf/include/include/Util/CoreBitVector.h +214 -0
  106. package/SVF-osx/svf/include/include/Util/CppUtil.h +81 -0
  107. package/SVF-osx/svf/include/include/Util/CxtStmt.h +501 -0
  108. package/SVF-osx/svf/include/include/Util/DPItem.h +618 -0
  109. package/SVF-osx/svf/include/include/Util/ExtAPI.h +339 -0
  110. package/SVF-osx/svf/include/include/Util/ExtAPI.json +5707 -0
  111. package/SVF-osx/svf/include/include/Util/GraphReachSolver.h +186 -0
  112. package/SVF-osx/svf/include/include/Util/NodeIDAllocator.h +194 -0
  113. package/SVF-osx/svf/include/include/Util/Options.h +266 -0
  114. package/SVF-osx/svf/include/include/Util/PTAStat.h +65 -0
  115. package/SVF-osx/svf/include/include/Util/SCC.h +354 -0
  116. package/SVF-osx/svf/include/include/Util/SVFStat.h +100 -0
  117. package/SVF-osx/svf/include/include/Util/SVFUtil.h +660 -0
  118. package/SVF-osx/svf/include/include/Util/SparseBitVector.h +1202 -0
  119. package/SVF-osx/svf/include/include/Util/ThreadAPI.h +330 -0
  120. package/SVF-osx/svf/include/include/Util/WorkList.h +317 -0
  121. package/SVF-osx/svf/include/include/Util/Z3Expr.h +318 -0
  122. package/SVF-osx/svf/include/include/Util/cJSON.h +300 -0
  123. package/SVF-osx/svf/include/include/Util/iterator.h +407 -0
  124. package/SVF-osx/svf/include/include/Util/iterator_range.h +76 -0
  125. package/SVF-osx/svf/include/include/WPA/Andersen.h +416 -0
  126. package/SVF-osx/svf/include/include/WPA/AndersenPWC.h +160 -0
  127. package/SVF-osx/svf/include/include/WPA/CSC.h +95 -0
  128. package/SVF-osx/svf/include/include/WPA/FlowSensitive.h +317 -0
  129. package/SVF-osx/svf/include/include/WPA/Steensgaard.h +126 -0
  130. package/SVF-osx/svf/include/include/WPA/TypeAnalysis.h +83 -0
  131. package/SVF-osx/svf/include/include/WPA/VersionedFlowSensitive.h +287 -0
  132. package/SVF-osx/svf/include/include/WPA/WPAFSSolver.h +254 -0
  133. package/SVF-osx/svf/include/include/WPA/WPAPass.h +119 -0
  134. package/SVF-osx/svf/include/include/WPA/WPASolver.h +205 -0
  135. package/SVF-osx/svf/include/include/WPA/WPAStat.h +222 -0
  136. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/BasicTypes.h +250 -0
  137. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/BreakConstantExpr.h +94 -0
  138. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/CHGBuilder.h +73 -0
  139. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/DCHG.h +484 -0
  140. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
  141. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/ICFGBuilder.h +106 -0
  142. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMLoopAnalysis.h +61 -0
  143. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMModule.h +360 -0
  144. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMUtil.h +466 -0
  145. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/SVFIRBuilder.h +417 -0
  146. package/SVF-osx/svf-llvm/include/SVF-LLVM/SVF-LLVM/SymbolTableBuilder.h +110 -0
  147. package/package.json +1 -1
@@ -0,0 +1,513 @@
1
+ //===- SVFGNode.h -- Sparse value-flow graph node-------------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-2018> <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 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 General Public License for more details.
17
+
18
+ // You should have received a copy of the GNU General Public License
19
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ //
21
+ //===----------------------------------------------------------------------===//
22
+
23
+ /*
24
+ * SVFGNode.h
25
+ *
26
+ * Created on: 13 Sep. 2018
27
+ * Author: Yulei Sui
28
+ */
29
+
30
+ #ifndef INCLUDE_MSSA_SVFGNODE_H_
31
+ #define INCLUDE_MSSA_SVFGNODE_H_
32
+
33
+ #include "Graphs/VFGNode.h"
34
+ #include "Graphs/SVFGEdge.h"
35
+
36
+ namespace SVF
37
+ {
38
+
39
+ /*!
40
+ * Memory region VFGNode (for address-taken objects)
41
+ */
42
+ class MRSVFGNode : public VFGNode
43
+ {
44
+ protected:
45
+ NodeBS cpts;
46
+
47
+ // This constructor can only be used by derived classes
48
+ MRSVFGNode(NodeID id, VFGNodeK k) : VFGNode(id, k) {}
49
+
50
+ public:
51
+ /// Return points-to of the MR
52
+ inline const NodeBS& getPointsTo() const
53
+ {
54
+ return cpts;
55
+ }
56
+
57
+ inline const NodeBS getDefSVFVars() const override;
58
+
59
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
60
+ //@{
61
+ static inline bool classof(const MRSVFGNode *)
62
+ {
63
+ return true;
64
+ }
65
+ static inline bool classof(const VFGNode *node)
66
+ {
67
+ return node->getNodeKind() == FPIN ||
68
+ node->getNodeKind() == FPOUT ||
69
+ node->getNodeKind() == APIN ||
70
+ node->getNodeKind() == APOUT ||
71
+ node->getNodeKind() == MPhi ||
72
+ node->getNodeKind() == MIntraPhi ||
73
+ node->getNodeKind() == MInterPhi;
74
+ }
75
+ static inline bool classof(const GenericVFGNodeTy *node)
76
+ {
77
+ return node->getNodeKind() == FPIN ||
78
+ node->getNodeKind() == FPOUT ||
79
+ node->getNodeKind() == APIN ||
80
+ node->getNodeKind() == APOUT ||
81
+ node->getNodeKind() == MPhi ||
82
+ node->getNodeKind() == MIntraPhi ||
83
+ node->getNodeKind() == MInterPhi;
84
+ }
85
+ //@}
86
+
87
+ virtual const std::string toString() const override;
88
+ };
89
+
90
+ /*
91
+ * SVFG Node stands for entry chi node (address-taken variables)
92
+ */
93
+ class FormalINSVFGNode : public MRSVFGNode
94
+ {
95
+ private:
96
+ const MRVer* ver;
97
+ const FunEntryICFGNode* funEntryNode;
98
+
99
+ public:
100
+ /// Constructor
101
+ FormalINSVFGNode(NodeID id, const MRVer* resVer, const FunEntryICFGNode* funEntry): MRSVFGNode(id, FPIN)
102
+ {
103
+ cpts = resVer->getMR()->getPointsTo();
104
+ ver = resVer;
105
+ funEntryNode = funEntry;
106
+ }
107
+ inline const MRVer* getMRVer() const
108
+ {
109
+ return ver;
110
+ }
111
+ inline const FunEntryICFGNode* getFunEntryNode() const
112
+ {
113
+ return funEntryNode;
114
+ }
115
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
116
+ //@{
117
+ static inline bool classof(const FormalINSVFGNode *)
118
+ {
119
+ return true;
120
+ }
121
+ static inline bool classof(const VFGNode *node)
122
+ {
123
+ return node->getNodeKind() == FPIN;
124
+ }
125
+ static inline bool classof(const GenericVFGNodeTy *node)
126
+ {
127
+ return node->getNodeKind() == FPIN;
128
+ }
129
+ //@}
130
+
131
+ virtual const std::string toString() const;
132
+ };
133
+
134
+
135
+ /*
136
+ * SVFG Node stands for return mu node (address-taken variables)
137
+ */
138
+ class FormalOUTSVFGNode : public MRSVFGNode
139
+ {
140
+ private:
141
+ const MRVer* ver;
142
+ const FunExitICFGNode* funExitNode;
143
+
144
+ public:
145
+ /// Constructor
146
+ FormalOUTSVFGNode(NodeID id, const MRVer* ver, const FunExitICFGNode* funExitNode);
147
+
148
+ inline const FunExitICFGNode* getFunExitNode() const
149
+ {
150
+ return funExitNode;
151
+ }
152
+
153
+ inline const MRVer* getMRVer() const
154
+ {
155
+ return ver;
156
+ }
157
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
158
+ //@{
159
+ static inline bool classof(const FormalOUTSVFGNode *)
160
+ {
161
+ return true;
162
+ }
163
+ static inline bool classof(const VFGNode *node)
164
+ {
165
+ return node->getNodeKind() == FPOUT;
166
+ }
167
+ static inline bool classof(const GenericVFGNodeTy *node)
168
+ {
169
+ return node->getNodeKind() == FPOUT;
170
+ }
171
+ //@}
172
+
173
+ virtual const std::string toString() const;
174
+ };
175
+
176
+
177
+ /*
178
+ * SVFG Node stands for callsite mu node (address-taken variables)
179
+ */
180
+ class ActualINSVFGNode : public MRSVFGNode
181
+ {
182
+ private:
183
+ const CallICFGNode* cs;
184
+ const MRVer* ver;
185
+ public:
186
+ /// Constructor
187
+ ActualINSVFGNode(NodeID id, const CallICFGNode* c, const MRVer* mrver):
188
+ MRSVFGNode(id, APIN), cs(c)
189
+ {
190
+ cpts = mrver->getMR()->getPointsTo();
191
+ ver = mrver;
192
+ }
193
+ /// Callsite
194
+ inline const CallICFGNode* getCallSite() const
195
+ {
196
+ return cs;
197
+ }
198
+
199
+ /// Ver
200
+ inline const MRVer* getMRVer() const
201
+ {
202
+ return ver;
203
+ }
204
+
205
+
206
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
207
+ //@{
208
+ static inline bool classof(const ActualINSVFGNode *)
209
+ {
210
+ return true;
211
+ }
212
+ static inline bool classof(const VFGNode *node)
213
+ {
214
+ return node->getNodeKind() == APIN;
215
+ }
216
+ static inline bool classof(const GenericVFGNodeTy *node)
217
+ {
218
+ return node->getNodeKind() == APIN;
219
+ }
220
+ //@}
221
+
222
+ virtual const std::string toString() const;
223
+ };
224
+
225
+
226
+ /*
227
+ * SVFG Node stands for callsite chi node (address-taken variables)
228
+ */
229
+ class ActualOUTSVFGNode : public MRSVFGNode
230
+ {
231
+ private:
232
+ const CallICFGNode* cs;
233
+ const MRVer* ver;
234
+
235
+ public:
236
+ /// Constructor
237
+ ActualOUTSVFGNode(NodeID id, const CallICFGNode* cal, const MRVer* resVer):
238
+ MRSVFGNode(id, APOUT), cs(cal)
239
+ {
240
+ cpts = resVer->getMR()->getPointsTo();
241
+ ver = resVer;
242
+ }
243
+ /// Callsite
244
+ inline const CallICFGNode* getCallSite() const
245
+ {
246
+ return cs;
247
+ }
248
+ /// Ver
249
+ inline const MRVer* getMRVer() const
250
+ {
251
+ return ver;
252
+ }
253
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
254
+ //@{
255
+ static inline bool classof(const ActualOUTSVFGNode *)
256
+ {
257
+ return true;
258
+ }
259
+ static inline bool classof(const VFGNode *node)
260
+ {
261
+ return node->getNodeKind() == APOUT;
262
+ }
263
+ static inline bool classof(const GenericVFGNodeTy *node)
264
+ {
265
+ return node->getNodeKind() == APOUT;
266
+ }
267
+ //@}
268
+
269
+ virtual const std::string toString() const;
270
+ };
271
+
272
+
273
+ /*
274
+ * SVFG Node stands for a memory ssa phi node or formalIn or ActualOut
275
+ */
276
+ class MSSAPHISVFGNode : public MRSVFGNode
277
+ {
278
+ public:
279
+ typedef Map<u32_t,const MRVer*> OPVers;
280
+
281
+ protected:
282
+ const MRVer* ver;
283
+ OPVers opVers;
284
+
285
+ public:
286
+ /// Constructor
287
+ MSSAPHISVFGNode(NodeID id, const MRVer* resVer,VFGNodeK k = MPhi): MRSVFGNode(id, k)
288
+ {
289
+ cpts = resVer->getMR()->getPointsTo();
290
+ ver = resVer;
291
+ }
292
+ /// Ver
293
+ inline const MRVer* getResVer() const
294
+ {
295
+ return ver;
296
+ }
297
+ /// MSSA phi operands
298
+ //@{
299
+ inline const MRVer* getOpVer(u32_t pos) const
300
+ {
301
+ OPVers::const_iterator it = opVers.find(pos);
302
+ assert(it!=opVers.end() && "version is nullptr, did not rename?");
303
+ return it->second;
304
+ }
305
+ inline void setOpVer(u32_t pos, const MRVer* node)
306
+ {
307
+ opVers[pos] = node;
308
+ }
309
+ inline u32_t getOpVerNum() const
310
+ {
311
+ return opVers.size();
312
+ }
313
+ inline OPVers::const_iterator opVerBegin() const
314
+ {
315
+ return opVers.begin();
316
+ }
317
+ inline OPVers::const_iterator opVerEnd() const
318
+ {
319
+ return opVers.end();
320
+ }
321
+ //@}
322
+
323
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
324
+ //@{
325
+ static inline bool classof(const MSSAPHISVFGNode *)
326
+ {
327
+ return true;
328
+ }
329
+ static inline bool classof(const MRSVFGNode *node)
330
+ {
331
+ return (node->getNodeKind() == MPhi || node->getNodeKind() == MIntraPhi || node->getNodeKind() == MInterPhi);
332
+ }
333
+ static inline bool classof(const VFGNode *node)
334
+ {
335
+ return (node->getNodeKind() == MPhi || node->getNodeKind() == MIntraPhi || node->getNodeKind() == MInterPhi);
336
+ }
337
+ static inline bool classof(const GenericVFGNodeTy *node)
338
+ {
339
+ return (node->getNodeKind() == MPhi || node->getNodeKind() == MIntraPhi || node->getNodeKind() == MInterPhi);
340
+ }
341
+ //@}
342
+
343
+ virtual const std::string toString() const;
344
+ };
345
+
346
+ /*
347
+ * Intra MSSA PHI
348
+ */
349
+ class IntraMSSAPHISVFGNode : public MSSAPHISVFGNode
350
+ {
351
+
352
+ public:
353
+ /// Constructor
354
+ IntraMSSAPHISVFGNode(NodeID id, const MRVer* resVer): MSSAPHISVFGNode(id, resVer, MIntraPhi)
355
+ {
356
+ }
357
+
358
+ inline const MRVer* getMRVer() const
359
+ {
360
+ return getResVer();
361
+ }
362
+
363
+ inline OPVers::const_iterator opVerBegin() const
364
+ {
365
+ return opVers.begin();
366
+ }
367
+
368
+ inline OPVers::const_iterator opVerEnd() const
369
+ {
370
+ return opVers.end();
371
+ }
372
+
373
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
374
+ //@{
375
+ static inline bool classof(const IntraMSSAPHISVFGNode *)
376
+ {
377
+ return true;
378
+ }
379
+ static inline bool classof(const MSSAPHISVFGNode * node)
380
+ {
381
+ return node->getNodeKind() == MIntraPhi;
382
+ }
383
+ static inline bool classof(const MRSVFGNode *node)
384
+ {
385
+ return node->getNodeKind() == MIntraPhi;
386
+ }
387
+ static inline bool classof(const VFGNode *node)
388
+ {
389
+ return node->getNodeKind() == MIntraPhi;
390
+ }
391
+ static inline bool classof(const GenericVFGNodeTy *node)
392
+ {
393
+ return node->getNodeKind() == MIntraPhi;
394
+ }
395
+ //@}
396
+
397
+ virtual const std::string toString() const;
398
+ };
399
+
400
+
401
+ /*
402
+ * Inter MSSA PHI (formalIN/ActualOUT)
403
+ */
404
+ class InterMSSAPHISVFGNode : public MSSAPHISVFGNode
405
+ {
406
+
407
+ public:
408
+ /// Constructor interPHI for formal parameter
409
+ InterMSSAPHISVFGNode(NodeID id, const FormalINSVFGNode* fi) : MSSAPHISVFGNode(id, fi->getMRVer(), MInterPhi),fun(fi->getFun()),callInst(nullptr) {}
410
+ /// Constructor interPHI for actual return
411
+ InterMSSAPHISVFGNode(NodeID id, const ActualOUTSVFGNode* ao) : MSSAPHISVFGNode(id, ao->getMRVer(), MInterPhi), fun(nullptr),callInst(ao->getCallSite()) {}
412
+
413
+ inline bool isFormalINPHI() const
414
+ {
415
+ return (fun!=nullptr) && (callInst == nullptr);
416
+ }
417
+
418
+ inline bool isActualOUTPHI() const
419
+ {
420
+ return (fun==nullptr) && (callInst != nullptr);
421
+ }
422
+
423
+ inline const SVFFunction* getFun() const
424
+ {
425
+ assert(isFormalINPHI() && "expect a formal parameter phi");
426
+ return fun;
427
+ }
428
+
429
+ inline const CallICFGNode* getCallSite() const
430
+ {
431
+ assert(isActualOUTPHI() && "expect a actual return phi");
432
+ return callInst;
433
+ }
434
+
435
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
436
+ //@{
437
+ static inline bool classof(const InterMSSAPHISVFGNode *)
438
+ {
439
+ return true;
440
+ }
441
+ static inline bool classof(const MSSAPHISVFGNode * node)
442
+ {
443
+ return node->getNodeKind() == MInterPhi;
444
+ }
445
+ static inline bool classof(const MRSVFGNode *node)
446
+ {
447
+ return node->getNodeKind() == MInterPhi;
448
+ }
449
+ static inline bool classof(const VFGNode *node)
450
+ {
451
+ return node->getNodeKind() == MInterPhi;
452
+ }
453
+ static inline bool classof(const GenericVFGNodeTy *node)
454
+ {
455
+ return node->getNodeKind() == MInterPhi;
456
+ }
457
+ //@}
458
+
459
+ virtual const std::string toString() const;
460
+
461
+ private:
462
+ const SVFFunction* fun;
463
+ const CallICFGNode* callInst;
464
+ };
465
+
466
+ /*
467
+ * Dummy node which encodes propagation of an object/version pair.
468
+ */
469
+ class DummyVersionPropSVFGNode : public VFGNode
470
+ {
471
+ public:
472
+ DummyVersionPropSVFGNode(NodeID id, NodeID object, Version version)
473
+ : VFGNode(id, DummyVProp), object(object), version(version)
474
+ { }
475
+
476
+ NodeID getObject(void) const
477
+ {
478
+ return object;
479
+ }
480
+ Version getVersion(void) const
481
+ {
482
+ return version;
483
+ }
484
+
485
+ /// Methods to support type inquiry through isa, cast, and dyn_cast:
486
+ //@{
487
+ static inline bool classof(const DummyVersionPropSVFGNode *)
488
+ {
489
+ return true;
490
+ }
491
+
492
+ static inline bool classof(const VFGNode *node)
493
+ {
494
+ return node->getNodeKind() == DummyVProp;
495
+ }
496
+
497
+ static inline bool classof(const GenericVFGNodeTy *node)
498
+ {
499
+ return node->getNodeKind() == DummyVProp;
500
+ }
501
+ //@}
502
+
503
+ const NodeBS getDefSVFVars() const override;
504
+
505
+ private:
506
+ const NodeID object;
507
+ const Version version;
508
+ };
509
+
510
+
511
+ } // End namespace SVF
512
+
513
+ #endif /* INCLUDE_MSSA_SVFGNODE_H_ */