-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSsa.qll
More file actions
42 lines (34 loc) · 1.26 KB
/
Ssa.qll
File metadata and controls
42 lines (34 loc) · 1.26 KB
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
42
/**
* Provides the module `Ssa` for working with static single assignment (SSA) form.
*/
/**
* Provides classes for working with static single assignment (SSA) form.
*/
module Ssa {
private import bicep
private import codeql.bicep.controlflow.BasicBlocks
private import codeql.bicep.controlflow.ControlFlowGraph
private import codeql.bicep.controlflow.internal.ControlFlowGraphImpl as CfgImpl
private import internal.SsaImpl as SsaImpl
class Variable = SsaImpl::SsaInput::SourceVariable;
class Definition extends SsaImpl::Definition {
final CfgNode getControlFlowNode() {
exists(BasicBlock bb, int i | this.definesAt(_, bb, i) | result = bb.getNode(i))
}
final CfgNode getARead() { result = SsaImpl::getARead(this) }
final CfgNode getAFirstRead() { SsaImpl::firstRead(this, result) }
}
class WriteDefinition extends Definition, SsaImpl::WriteDefinition {
final CfgNode getControlFlowNode() {
exists(BasicBlock bb, int i | this.definesAt(_, bb, i) | result = bb.getNode(i))
}
final CfgNode getARead() { result = SsaImpl::getARead(this) }
cached
override Location getLocation() {
exists(BasicBlock bb, int i |
this.definesAt(_, bb, i) and
result = bb.getNode(i).getLocation()
)
}
}
}