1+ /**
2+ * Provides the module `Ssa` for working with static single assignment (SSA) form.
3+ */
4+
5+ /**
6+ * Provides classes for working with static single assignment (SSA) form.
7+ */
8+ module Ssa {
9+ private import bicep
10+ private import codeql.bicep.controlflow.BasicBlocks
11+ private import codeql.bicep.controlflow.ControlFlowGraph
12+ private import codeql.bicep.controlflow.internal.ControlFlowGraphImpl as CfgImpl
13+ private import internal.SsaImpl as SsaImpl
14+
15+ class Variable = SsaImpl:: SsaInput:: SourceVariable ;
16+
17+ class Definition extends SsaImpl:: Definition {
18+ final CfgNode getControlFlowNode ( ) {
19+ exists ( BasicBlock bb , int i | this .definesAt ( _, bb , i ) | result = bb .getNode ( i ) )
20+ }
21+
22+ final CfgNode getARead ( ) { result = SsaImpl:: getARead ( this ) }
23+
24+ final CfgNode getAFirstRead ( ) { SsaImpl:: firstRead ( this , result ) }
25+ }
26+
27+ class WriteDefinition extends Definition , SsaImpl:: WriteDefinition {
28+ final CfgNode getControlFlowNode ( ) {
29+ exists ( BasicBlock bb , int i | this .definesAt ( _, bb , i ) | result = bb .getNode ( i ) )
30+ }
31+
32+ final CfgNode getARead ( ) { result = SsaImpl:: getARead ( this ) }
33+
34+ cached
35+ override Location getLocation ( ) {
36+ exists ( BasicBlock bb , int i |
37+ this .definesAt ( _, bb , i ) and
38+ result = bb .getNode ( i ) .getLocation ( )
39+ )
40+ }
41+ }
42+ }
0 commit comments