svf-tools 1.0.1032 → 1.0.1034

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 (35) hide show
  1. package/package.json +1 -1
  2. package/svf/include/Graphs/BasicBlockG.h +310 -0
  3. package/svf/include/Graphs/GenericGraph.h +106 -91
  4. package/svf/include/SVFIR/SVFIR.h +71 -73
  5. package/svf/include/SVFIR/SVFValue.h +25 -124
  6. package/svf/include/SVFIR/SVFVariables.h +270 -283
  7. package/svf/lib/AE/Core/AbstractState.cpp +5 -5
  8. package/svf/lib/CFL/CFLGraphBuilder.cpp +0 -1
  9. package/svf/lib/Graphs/BasicBlockG.cpp +10 -0
  10. package/svf/lib/Graphs/ConsG.cpp +2 -2
  11. package/svf/lib/Graphs/IRGraph.cpp +2 -2
  12. package/svf/lib/MSSA/MemRegion.cpp +1 -1
  13. package/svf/lib/MSSA/MemSSA.cpp +1 -1
  14. package/svf/lib/MTA/LockAnalysis.cpp +2 -1
  15. package/svf/lib/MTA/MHP.cpp +2 -1
  16. package/svf/lib/MTA/MTA.cpp +2 -1
  17. package/svf/lib/MTA/MTAStat.cpp +1 -1
  18. package/svf/lib/MemoryModel/AccessPath.cpp +5 -5
  19. package/svf/lib/SABER/SaberCondAllocator.cpp +3 -3
  20. package/svf/lib/SVFIR/PAGBuilderFromFile.cpp +2 -2
  21. package/svf/lib/SVFIR/SVFIR.cpp +5 -5
  22. package/svf/lib/SVFIR/SVFStatements.cpp +1 -1
  23. package/svf/lib/SVFIR/SVFValue.cpp +1 -68
  24. package/svf/lib/SVFIR/SVFVariables.cpp +76 -107
  25. package/svf/lib/Util/CDGBuilder.cpp +2 -1
  26. package/svf/lib/Util/CallGraphBuilder.cpp +6 -3
  27. package/svf/lib/Util/SVFStat.cpp +1 -1
  28. package/svf/lib/Util/ThreadAPI.cpp +1 -1
  29. package/svf-llvm/include/SVF-LLVM/LLVMModule.h +8 -4
  30. package/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +1 -1
  31. package/svf-llvm/lib/LLVMModule.cpp +5 -8
  32. package/svf-llvm/lib/LLVMUtil.cpp +13 -5
  33. package/svf-llvm/lib/ObjTypeInference.cpp +4 -4
  34. package/svf-llvm/lib/SVFIRBuilder.cpp +47 -35
  35. package/svf-llvm/lib/SVFIRExtAPI.cpp +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1032",
3
+ "version": "1.0.1034",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,310 @@
1
+ //===- BasicBlockG.h -- BasicBlock node------------------------------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-2025> <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
+ * ICFGNode.h
25
+ *
26
+ * Created on: 23 Jan, 2025
27
+ * Author: Jiawei, Xiao
28
+ */
29
+
30
+ #ifndef BASICBLOCKGRAPH_H_
31
+ #define BASICBLOCKGRAPH_H_
32
+ #include "GenericGraph.h"
33
+ #include <sstream>
34
+ #include <algorithm>
35
+
36
+
37
+ namespace SVF
38
+ {
39
+ class SVFBasicBlock;
40
+ class BasicBlockEdge;
41
+ class ICFGNode;
42
+ class SVFFunction;
43
+ typedef GenericEdge<SVFBasicBlock> GenericBasicBlockEdgeTy;
44
+ class BasicBlockEdge: public GenericBasicBlockEdgeTy
45
+ {
46
+ friend class SVFIRWriter;
47
+ friend class SVFIRReader;
48
+
49
+ public:
50
+ public:
51
+ /// Constructor
52
+ BasicBlockEdge(SVFBasicBlock* s, SVFBasicBlock* d) : GenericBasicBlockEdgeTy(s, d, 0)
53
+ {
54
+ }
55
+ /// Destructor
56
+ ~BasicBlockEdge() {}
57
+
58
+ /// Overloading operator << for dumping ICFG node ID
59
+ //@{
60
+ friend OutStream& operator<<(OutStream& o, const BasicBlockEdge& edge)
61
+ {
62
+ o << edge.toString();
63
+ return o;
64
+ }
65
+ //@}
66
+
67
+ virtual const std::string toString() const;
68
+ };
69
+
70
+
71
+ typedef GenericNode<SVFBasicBlock, BasicBlockEdge> GenericBasicBlockNodeTy;
72
+ class SVFBasicBlock : public GenericBasicBlockNodeTy
73
+ {
74
+ friend class LLVMModuleSet;
75
+ friend class SVFIRWriter;
76
+ friend class SVFIRReader;
77
+ friend class SVFIRBuilder;
78
+ friend class SVFFunction;
79
+ friend class ICFGBuilder;
80
+ friend class ICFG;
81
+
82
+ public:
83
+ typedef std::vector<const ICFGNode*>::const_iterator const_iterator;
84
+ std::vector<const SVFBasicBlock*> succBBs;
85
+ std::vector<const SVFBasicBlock*> predBBs;
86
+
87
+ private:
88
+ std::vector<const ICFGNode*> allICFGNodes; ///< all ICFGNodes in this BasicBlock
89
+ const SVFFunction* fun; /// Function where this BasicBlock is
90
+
91
+
92
+
93
+ protected:
94
+ ///@{ attributes to be set only through Module builders e.g., LLVMModule
95
+
96
+ inline void addICFGNode(const ICFGNode* icfgNode)
97
+ {
98
+ assert(std::find(getICFGNodeList().begin(), getICFGNodeList().end(),
99
+ icfgNode) == getICFGNodeList().end() && "duplicated icfgnode");
100
+ allICFGNodes.push_back(icfgNode);
101
+ }
102
+
103
+ /// @}
104
+
105
+ public:
106
+ /// Constructor without name
107
+ SVFBasicBlock(NodeID id, const SVFFunction* f): GenericBasicBlockNodeTy(id, BasicBlockKd), fun(f)
108
+ {
109
+
110
+ }
111
+ SVFBasicBlock() = delete;
112
+ ~SVFBasicBlock()
113
+ {
114
+
115
+ }
116
+
117
+ static inline bool classof(const SVFBaseNode* node)
118
+ {
119
+ return node->getNodeKind() == SVFBaseNode::BasicBlockKd;
120
+ }
121
+
122
+ static inline bool classof(const SVFBasicBlock* node)
123
+ {
124
+ return true;
125
+ }
126
+
127
+ //@{
128
+ friend OutStream &operator<<(OutStream &o, const SVFBasicBlock&node)
129
+ {
130
+ o << node.toString();
131
+ return o;
132
+ }
133
+ //@}
134
+
135
+
136
+ inline const std::vector<const ICFGNode*>& getICFGNodeList() const
137
+ {
138
+ return allICFGNodes;
139
+ }
140
+
141
+ inline const_iterator begin() const
142
+ {
143
+ return allICFGNodes.begin();
144
+ }
145
+
146
+ inline const_iterator end() const
147
+ {
148
+ return allICFGNodes.end();
149
+ }
150
+
151
+ inline void addSuccBasicBlock(const SVFBasicBlock* succ2)
152
+ {
153
+ // check if the edge already exists
154
+ for (auto edge: this->getOutEdges())
155
+ {
156
+ if (edge->getDstNode() == succ2)
157
+ return;
158
+ }
159
+
160
+ SVFBasicBlock* succ = const_cast<SVFBasicBlock*>(succ2);
161
+ BasicBlockEdge* edge = new BasicBlockEdge(this, succ);
162
+ this->addOutgoingEdge(edge);
163
+ succ->addIncomingEdge(edge);
164
+ this->succBBs.push_back(succ);
165
+ succ->predBBs.push_back(this);
166
+ }
167
+
168
+ inline void addPredBasicBlock(const SVFBasicBlock* pred2)
169
+ {
170
+ // check if the edge already exists
171
+ for (auto edge: this->getInEdges())
172
+ {
173
+ if (edge->getSrcNode() == pred2)
174
+ return;
175
+ }
176
+ SVFBasicBlock* pred = const_cast<SVFBasicBlock*>(pred2);
177
+ BasicBlockEdge* edge = new BasicBlockEdge(pred, this);
178
+ this->addIncomingEdge(edge);
179
+ pred->addOutgoingEdge(edge);
180
+ this->predBBs.push_back(pred);
181
+ pred->succBBs.push_back(this);
182
+ }
183
+
184
+ inline const SVFFunction* getParent() const
185
+ {
186
+ return fun;
187
+ }
188
+
189
+ inline const SVFFunction* getFunction() const
190
+ {
191
+ return fun;
192
+ }
193
+
194
+ inline const ICFGNode* front() const
195
+ {
196
+ assert(!allICFGNodes.empty() && "bb empty?");
197
+ return allICFGNodes.front();
198
+ }
199
+
200
+ inline const ICFGNode* back() const
201
+ {
202
+ assert(!allICFGNodes.empty() && "bb empty?");
203
+ return allICFGNodes.back();
204
+ }
205
+
206
+ inline std::vector<const SVFBasicBlock*> getSuccessors() const
207
+ {
208
+ std::vector<const SVFBasicBlock*> res;
209
+ for (auto edge : this->getOutEdges())
210
+ {
211
+ res.push_back(edge->getDstNode());
212
+ }
213
+ return res;
214
+ }
215
+
216
+ inline std::vector<const SVFBasicBlock*> getPredecessors() const
217
+ {
218
+ std::vector<const SVFBasicBlock*> res;
219
+ for (auto edge : this->getInEdges())
220
+ {
221
+ res.push_back(edge->getSrcNode());
222
+ }
223
+ return res;
224
+ }
225
+ u32_t getNumSuccessors() const
226
+ {
227
+ return this->getOutEdges().size();
228
+ }
229
+ u32_t getBBSuccessorPos(const SVFBasicBlock* Succ)
230
+ {
231
+ u32_t i = 0;
232
+ for (const SVFBasicBlock* SuccBB: succBBs)
233
+ {
234
+ if (SuccBB == Succ)
235
+ return i;
236
+ i++;
237
+ }
238
+ assert(false && "Didn't find successor edge?");
239
+ return 0;
240
+ }
241
+ u32_t getBBSuccessorPos(const SVFBasicBlock* Succ) const
242
+ {
243
+ u32_t i = 0;
244
+ for (const SVFBasicBlock* SuccBB: succBBs)
245
+ {
246
+ if (SuccBB == Succ)
247
+ return i;
248
+ i++;
249
+ }
250
+ assert(false && "Didn't find successor edge?");
251
+ return 0;
252
+
253
+ }
254
+ u32_t getBBPredecessorPos(const SVFBasicBlock* succbb)
255
+ {
256
+ u32_t pos = 0;
257
+ for (const SVFBasicBlock* PredBB : succbb->getPredecessors())
258
+ {
259
+ if(PredBB == this)
260
+ return pos;
261
+ ++pos;
262
+ }
263
+ assert(false && "Didn't find predecessor edge?");
264
+ return pos;
265
+ }
266
+ u32_t getBBPredecessorPos(const SVFBasicBlock* succbb) const
267
+ {
268
+ u32_t pos = 0;
269
+ for (const SVFBasicBlock* PredBB : succbb->getPredecessors())
270
+ {
271
+ if(PredBB == this)
272
+ return pos;
273
+ ++pos;
274
+ }
275
+ assert(false && "Didn't find predecessor edge?");
276
+ return pos;
277
+ }
278
+
279
+ const std::string toString() const;
280
+
281
+ };
282
+
283
+
284
+
285
+ typedef GenericGraph<SVFBasicBlock, BasicBlockEdge> GenericBasicBlockGraphTy;
286
+ class BasicBlockGraph: public GenericBasicBlockGraphTy
287
+ {
288
+ private:
289
+ NodeID id{0};
290
+ const SVFFunction* fun;
291
+ public:
292
+ /// Constructor
293
+ BasicBlockGraph(const SVFFunction* f): fun(f)
294
+ {
295
+
296
+ }
297
+
298
+ SVFBasicBlock* addBasicBlock(const std::string& bbname)
299
+ {
300
+ id++;
301
+ SVFBasicBlock* bb = new SVFBasicBlock(id, fun);
302
+ addGNode(id, bb);
303
+ bb->setName(bbname);
304
+ return bb;
305
+ }
306
+
307
+ };
308
+ }
309
+
310
+ #endif
@@ -141,96 +141,111 @@ public:
141
141
 
142
142
  enum GNodeK
143
143
  {
144
- // ┌── ICFGNode: Classes of inter-procedural and intra-procedural control flow graph nodes
145
- IntraBlock, // ├──Represents a node within a single procedure
146
- GlobalBlock, // ├──Represents a global-level block
147
- // │ └─ InterICFGNode: Classes of inter-procedural control flow graph nodes
148
- FunEntryBlock, // ├──Entry point of a function
149
- FunExitBlock, // ├──Exit point of a function
150
- FunCallBlock, // ├──Call site in the function
151
- FunRetBlock, // ├──Return site in the function
152
- // └────────
153
-
154
- // ┌── SVFVar: Classes of top-level variables (ValVar) and address-taken variables (ObjVar)
155
- // │ └── ValVar: Classes of top-level variable nodes
156
- ValNode, // ├──Represents a standard value variable
157
- ArgNode, // ├──Represents an argument value variable
158
- FunValNode, // ├──Represents a Function value variable
159
- GepValNode, // ├──Represents a GEP value variable
160
- RetNode, // ├──Represents a return value node
161
- VarargNode, // ├──Represents a variadic argument node
162
- GlobalValNode, // ├──Represents a global variable node
163
- ConstantAggValNode, // ├──Represents a constant aggregate value node
164
- ConstantDataValNode, // ├──Represents a constant data variable
165
- BlackHoleNode, // ├──Represents a black hole node
166
- ConstantFPValNode, // ├──Represents a constant float-point value node
167
- ConstantIntValNode, // ├── Represents a constant integer value node
168
- ConstantNullptrValNode, // ├── Represents a constant nullptr value node
169
- DummyValNode, // ├──Represents a dummy node for uninitialized values
170
- // │ └── ObjVar: Classes of object variable nodes
171
- ObjNode, // ├──Represents an object variable
172
- GepObjNode, // ├──Represents a GEP object variable
173
- // │ └── BaseObjVar: Classes of base object nodes
174
- BaseObjNode, // ├──Represents a base object node
175
- FunObjNode, // ├──Types of function object
176
- HeapObjNode, // ├──Types of heap object
177
- StackObjNode, // ├──Types of stack object
178
- GlobalObjNode, // ├──Types of global object
179
- ConstantAggObjNode, // ├──Types of constant aggregate object
180
- ConstantDataObjNode, // ├──Types of constant data object
181
- ConstantFPObjNode, // ├──Types of constant float-point object
182
- ConstantIntObjNode, // ├──Types of constant integer object
183
- ConstantNullptrObjNode, // ├──Types of constant nullptr object
184
- DummyObjNode, // ├──Dummy node for uninitialized objects
185
- // └────────
186
-
187
- // ┌── VFGNode: Classes of Value Flow Graph (VFG) node kinds with operations
188
- Cmp, // ├──Represents a comparison operation
189
- BinaryOp, // ├──Represents a binary operation
190
- UnaryOp, // ├──Represents a unary operation
191
- Branch, // ├──Represents a branch operation
192
- DummyVProp, // ├──Dummy node for value propagation
193
- NPtr, // ├──Represents a null pointer operation
194
- // │ └── ArgumentVFGNode: Classes of argument nodes in VFG
195
- FRet, // ├──Represents a function return value
196
- ARet, // ├──Represents an argument return value
197
- AParm, // ├──Represents an argument parameter
198
- FParm, // ├──Represents a function parameter
199
- // │ └── StmtVFGNode: Classes of statement nodes in VFG
200
- Addr, // ├──Represents an address operation
201
- Copy, // ├──Represents a copy operation
202
- Gep, // ├──Represents a GEP operation
203
- Store, // ├──Represents a store operation
204
- Load, // ├──Represents a load operation
205
- // │ └── PHIVFGNode: Classes of PHI nodes in VFG
206
- TPhi, // ├──Represents a type-based PHI node
207
- TIntraPhi, // ├──Represents an intra-procedural PHI node
208
- TInterPhi, // ├──Represents an inter-procedural PHI node
209
- // │ └── MRSVFGNode: Classes of Memory-related SVFG nodes
210
- FPIN, // ├──Function parameter input
211
- FPOUT, // ├──Function parameter output
212
- APIN, // ├──Argument parameter input
213
- APOUT, // ├──Argument parameter output
214
- // │ └── MSSAPHISVFGNode: Classes of Mem SSA PHI nodes for SVFG
215
- MPhi, // ├──Memory PHI node
216
- MIntraPhi, // ├──Intra-procedural memory PHI node
217
- MInterPhi, // ├──Inter-procedural memory PHI node
218
- // └────────
219
-
220
- // Additional specific graph node types
221
- CallNodeKd, // Callgraph node
222
- CDNodeKd, // Control dependence graph node
223
- CFLNodeKd, // CFL graph node
224
- CHNodeKd, // Class hierarchy graph node
144
+ // ┌─────────────────────────────────────────────────────────────────────────┐
145
+ // ICFGNode: Classes of inter-procedural and intra-procedural control flow │
146
+ // graph nodes (Parent class: ICFGNode) │
147
+ // └─────────────────────────────────────────────────────────────────────────┘
148
+ IntraBlock, // ├── Represents a node within a single procedure
149
+ GlobalBlock, // ├── Represents a global-level block
150
+ // │ └─ Subclass: InterICFGNode
151
+ FunEntryBlock, // ├── Entry point of a function
152
+ FunExitBlock, // │ ├── Exit point of a function
153
+ FunCallBlock, // │ ├── Call site in the function
154
+ FunRetBlock, // │ └── Return site in the function
155
+
156
+ // ┌─────────────────────────────────────────────────────────────────────────┐
157
+ // SVFVar: Classes of variable nodes (Parent class: SVFVar) │
158
+ // │ Includes two main subclasses: ValVar and ObjVar │
159
+ // └─────────────────────────────────────────────────────────────────────────┘
160
+ // └─ Subclass: ValVar (Top-level variable nodes)
161
+ ValNode, // ├── Represents a standard value variable
162
+ ArgValNode, // ├── Represents an argument value variable
163
+ FunValNode, // ├── Represents a function value variable
164
+ GepValNode, // ├── Represents a GEP value variable
165
+ RetValNode, // ├── Represents a return value node
166
+ VarargValNode, // ├── Represents a variadic argument node
167
+ GlobalValNode, // ├── Represents a global variable node
168
+ ConstAggValNode, // ├── Represents a constant aggregate value node
169
+ // │ └─ Subclass: ConstDataValVar
170
+ ConstDataValNode, // │ ├── Represents a constant data variable
171
+ BlackHoleValNode, // ├── Represents a black hole node
172
+ ConstFPValNode, // ├── Represents a constant floating-point value node
173
+ ConstIntValNode, // │ ├── Represents a constant integer value node
174
+ ConstNullptrValNode, // │ └── Represents a constant nullptr value node
175
+ // │ └─ Subclass: DummyValVar
176
+ DummyValNode, // │ └── Dummy node for uninitialized values
177
+
178
+ // └─ Subclass: ObjVar (Object variable nodes)
179
+ ObjNode, // ├── Represents an object variable
180
+ // │ └─ Subclass: GepObjVar
181
+ GepObjNode, // ├── Represents a GEP object variable
182
+ // │ └─ Subclass: BaseObjVar
183
+ BaseObjNode, // ├── Represents a base object node
184
+ FunObjNode, // ├── Represents a function object
185
+ HeapObjNode, // │ ├── Represents a heap object
186
+ StackObjNode, // │ ├── Represents a stack object
187
+ GlobalObjNode, // │ ├── Represents a global object
188
+ ConstAggObjNode, // ├── Represents a constant aggregate object
189
+ // │ └─ Subclass: ConstDataObjVar
190
+ ConstDataObjNode, // ├── Represents a constant data object
191
+ ConstFPObjNode, // ├── Represents a constant floating-point object
192
+ ConstIntObjNode, // ├── Represents a constant integer object
193
+ ConstNullptrObjNode, // │ └── Represents a constant nullptr object
194
+ // │ └─ Subclass: DummyObjVar
195
+ DummyObjNode, // │ └── Dummy node for uninitialized objects
196
+
197
+ // ┌─────────────────────────────────────────────────────────────────────────┐
198
+ // VFGNode: Classes of Value Flow Graph (VFG) node kinds (Parent class: │
199
+ // │ VFGNode) │
200
+ // │ Includes operation nodes and specialized subclasses │
201
+ // └─────────────────────────────────────────────────────────────────────────┘
202
+ Cmp, // ├── Represents a comparison operation
203
+ BinaryOp, // ├── Represents a binary operation
204
+ UnaryOp, // ├── Represents a unary operation
205
+ Branch, // ├── Represents a branch operation
206
+ DummyVProp, // ├── Dummy node for value propagation
207
+ NPtr, // ├── Represents a null pointer operation
208
+ // │ └─ Subclass: ArgumentVFGNode
209
+ FRet, // │ ├── Represents a function return value
210
+ ARet, // ├── Represents an argument return value
211
+ AParm, // ├── Represents an argument parameter
212
+ FParm, // │ └── Represents a function parameter
213
+ // │ └─ Subclass: StmtVFGNode
214
+ Addr, // │ ├── Represents an address operation
215
+ Copy, // ├── Represents a copy operation
216
+ Gep, // ├── Represents a GEP operation
217
+ Store, // ├── Represents a store operation
218
+ Load, // │ └── Represents a load operation
219
+ // │ └─ Subclass: PHIVFGNode
220
+ TPhi, // │ ├── Represents a type-based PHI node
221
+ TIntraPhi, // │ ├── Represents an intra-procedural PHI node
222
+ TInterPhi, // │ └── Represents an inter-procedural PHI node
223
+ // │ └─ Subclass: MRSVFGNode
224
+ FPIN, // │ ├── Function parameter input
225
+ FPOUT, // │ ├── Function parameter output
226
+ APIN, // │ ├── Argument parameter input
227
+ APOUT, // │ └── Argument parameter output
228
+ // │ └─ Subclass: MSSAPHISVFGNode
229
+ MPhi, // │ ├── Memory PHI node
230
+ MIntraPhi, // │ ├── Intra-procedural memory PHI node
231
+ MInterPhi, // │ └── Inter-procedural memory PHI node
232
+
233
+ // ┌─────────────────────────────────────────────────────────────────────────┐
234
+ // │ Additional specific graph node types │
235
+ // └─────────────────────────────────────────────────────────────────────────┘
236
+ CallNodeKd, // Callgraph node
237
+ CDNodeKd, // Control dependence graph node
238
+ CFLNodeKd, // CFL graph node
239
+ CHNodeKd, // Class hierarchy graph node
225
240
  ConstraintNodeKd, // Constraint graph node
226
- TCTNodeKd, // Thread creation tree node
227
- DCHNodeKd, // DCHG node
228
- OtherKd // Other node kind
241
+ TCTNodeKd, // Thread creation tree node
242
+ DCHNodeKd, // DCHG node
243
+ BasicBlockKd, // Basic block node
244
+ OtherKd // Other node kind
229
245
  };
230
246
 
231
247
 
232
-
233
- SVFBaseNode(NodeID i, GNodeK k, SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
248
+ SVFBaseNode(NodeID i, GNodeK k, const SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
234
249
  {
235
250
 
236
251
  }
@@ -326,10 +341,10 @@ protected:
326
341
 
327
342
  static inline bool isConstantDataValVar(GNodeK n)
328
343
  {
329
- static_assert(ConstantNullptrValNode - ConstantDataValNode == 4,
344
+ static_assert(ConstNullptrValNode - ConstDataValNode == 4,
330
345
  "The number of ConstantDataValVarKinds has changed, make "
331
346
  "sure the range is correct");
332
- return n <= ConstantNullptrValNode && n >= ConstantDataValNode;
347
+ return n <= ConstNullptrValNode && n >= ConstDataValNode;
333
348
  }
334
349
 
335
350
  static inline bool isObjVarKinds(GNodeK n)
@@ -350,10 +365,10 @@ protected:
350
365
 
351
366
  static inline bool isConstantDataObjVarKinds(GNodeK n)
352
367
  {
353
- static_assert(ConstantNullptrObjNode - ConstantDataObjNode == 3,
368
+ static_assert(ConstNullptrObjNode - ConstDataObjNode == 3,
354
369
  "The number of ConstantDataObjVarKinds has changed, make "
355
370
  "sure the range is correct");
356
- return n <= ConstantNullptrObjNode && n >= ConstantDataObjNode;
371
+ return n <= ConstNullptrObjNode && n >= ConstDataObjNode;
357
372
  }
358
373
 
359
374
  static inline bool isVFGNodeKinds(GNodeK n)
@@ -433,7 +448,7 @@ private:
433
448
 
434
449
  public:
435
450
  /// Constructor
436
- GenericNode(NodeID i, GNodeK k): SVFBaseNode(i, k)
451
+ GenericNode(NodeID i, GNodeK k, const SVFType* svfType = nullptr): SVFBaseNode(i, k, svfType)
437
452
  {
438
453
 
439
454
  }