-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathNodes.qll
More file actions
41 lines (26 loc) · 956 Bytes
/
Nodes.qll
File metadata and controls
41 lines (26 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
private import semmle.code.cpp.ir.dataflow.DataFlow as IR
private import semmle.code.cpp.dataflow.DataFlow as AST
private import cpp
private newtype TNode =
TAstNode(AST::DataFlow::Node n) or
TIRNode(IR::DataFlow::Node n)
class Node extends TNode {
string toString() { none() }
IR::DataFlow::Node asIR() { none() }
AST::DataFlow::Node asAst() { none() }
Location getLocation() { none() }
}
class AstNode extends Node, TAstNode {
AST::DataFlow::Node n;
AstNode() { this = TAstNode(n) }
override string toString() { result = n.toString() }
override AST::DataFlow::Node asAst() { result = n }
override Location getLocation() { result = n.getLocation() }
}
class IRNode extends Node, TIRNode {
IR::DataFlow::Node n;
IRNode() { this = TIRNode(n) }
override string toString() { result = n.toString() }
override IR::DataFlow::Node asIR() { result = n }
override Location getLocation() { result = n.getLocation() }
}