@@ -14,7 +14,7 @@ module PreSsa {
1414 private predicate definitionAt (
1515 AssignableDefinition def , SsaInput:: BasicBlock bb , int i , SsaInput:: SourceVariable v
1616 ) {
17- bb .getElement ( i ) = def .getExpr ( ) and
17+ bb .getNode ( i ) = def .getExpr ( ) and
1818 v = def .getTarget ( ) and
1919 // In cases like `(x, x) = (0, 1)`, we discard the first (dead) definition of `x`
2020 not exists ( TupleAssignmentDefinition first , TupleAssignmentDefinition second | first = def |
@@ -80,16 +80,10 @@ module PreSsa {
8080 }
8181
8282 module SsaInput implements SsaImplCommon:: InputSig< Location > {
83- class BasicBlock extends PreBasicBlocks:: PreBasicBlock {
84- ControlFlowNode getNode ( int i ) { result = this .getElement ( i ) }
85- }
83+ class BasicBlock = PreBasicBlocks:: PreBasicBlock ;
8684
8785 class ControlFlowNode = ControlFlowElement ;
8886
89- BasicBlock getImmediateBasicBlockDominator ( BasicBlock bb ) { result .immediatelyDominates ( bb ) }
90-
91- BasicBlock getABasicBlockSuccessor ( BasicBlock bb ) { result = bb .getASuccessor ( ) }
92-
9387 private class ExitBasicBlock extends BasicBlock {
9488 ExitBasicBlock ( ) { scopeLast ( _, this .getLastElement ( ) , _) }
9589 }
@@ -142,7 +136,7 @@ module PreSsa {
142136
143137 predicate variableRead ( BasicBlock bb , int i , SourceVariable v , boolean certain ) {
144138 exists ( AssignableRead read |
145- read = bb .getElement ( i ) and
139+ read = bb .getNode ( i ) and
146140 read .getTarget ( ) = v and
147141 certain = true
148142 )
@@ -163,7 +157,7 @@ module PreSsa {
163157 final AssignableRead getARead ( ) {
164158 exists ( SsaInput:: BasicBlock bb , int i |
165159 SsaImpl:: ssaDefReachesRead ( _, this , bb , i ) and
166- result = bb .getElement ( i )
160+ result = bb .getNode ( i )
167161 )
168162 }
169163
@@ -177,7 +171,7 @@ module PreSsa {
177171 final AssignableRead getAFirstRead ( ) {
178172 exists ( SsaInput:: BasicBlock bb , int i |
179173 SsaImpl:: firstUse ( this , bb , i , true ) and
180- result = bb .getElement ( i )
174+ result = bb .getNode ( i )
181175 )
182176 }
183177
@@ -214,9 +208,9 @@ module PreSsa {
214208
215209 predicate adjacentReadPairSameVar ( AssignableRead read1 , AssignableRead read2 ) {
216210 exists ( SsaInput:: BasicBlock bb1 , int i1 , SsaInput:: BasicBlock bb2 , int i2 |
217- read1 = bb1 .getElement ( i1 ) and
211+ read1 = bb1 .getNode ( i1 ) and
218212 SsaImpl:: adjacentUseUse ( bb1 , i1 , bb2 , i2 , _, true ) and
219- read2 = bb2 .getElement ( i2 )
213+ read2 = bb2 .getNode ( i2 )
220214 )
221215 }
222216}
0 commit comments