@@ -64,18 +64,18 @@ predicate trivialPat(Pat p) { p instanceof WildcardPat or p instanceof IdentPat
6464class AsmExprTree extends LeafTree instanceof AsmExpr { }
6565
6666class AwaitExprTree extends StandardPostOrderTree instanceof AwaitExpr {
67- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
67+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
6868}
6969
7070// NOTE: `become` is a reserved but unused keyword.
7171class BecomeExprTree extends StandardPostOrderTree instanceof BecomeExpr {
72- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
72+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
7373}
7474
7575class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryExpr {
7676 BinaryOpExprTree ( ) { not this instanceof BinaryLogicalOperation }
7777
78- override ControlFlowTree getChildNode ( int i ) {
78+ override AstNode getChildNode ( int i ) {
7979 i = 0 and result = super .getLhs ( )
8080 or
8181 i = 1 and result = super .getRhs ( )
@@ -133,7 +133,7 @@ class LogicalAndBinaryOpExprTree extends PreOrderTree, LogicalAndExpr {
133133}
134134
135135class BlockExprBaseTree extends StandardPostOrderTree instanceof BlockExpr {
136- override ControlFlowTree getChildNode ( int i ) {
136+ override AstNode getChildNode ( int i ) {
137137 result = super .getStmtList ( ) .getStatement ( i )
138138 or
139139 not exists ( super .getStmtList ( ) .getStatement ( i ) ) and
@@ -157,27 +157,27 @@ class BreakExprTree extends PostOrderTree instanceof BreakExpr {
157157}
158158
159159class CallExprTree extends StandardPostOrderTree instanceof CallExpr {
160- override ControlFlowTree getChildNode ( int i ) {
160+ override AstNode getChildNode ( int i ) {
161161 i = 0 and result = super .getExpr ( )
162162 or
163163 result = super .getArgList ( ) .getArg ( i - 1 )
164164 }
165165}
166166
167167class CastExprTree extends StandardPostOrderTree instanceof CastExpr {
168- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
168+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
169169}
170170
171171class ClosureExprTree extends LeafTree instanceof ClosureExpr { }
172172
173173class ContinueExprTree extends LeafTree instanceof ContinueExpr { }
174174
175175class ExprStmtTree extends StandardPreOrderTree instanceof ExprStmt {
176- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
176+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
177177}
178178
179179class FieldExprTree extends StandardPostOrderTree instanceof FieldExpr {
180- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
180+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
181181}
182182
183183class FunctionTree extends LeafTree instanceof Function { }
@@ -219,7 +219,7 @@ class IfExprTree extends PostOrderTree instanceof IfExpr {
219219}
220220
221221class IndexExprTree extends StandardPostOrderTree instanceof IndexExpr {
222- override ControlFlowTree getChildNode ( int i ) {
222+ override AstNode getChildNode ( int i ) {
223223 i = 0 and result = super .getBase ( )
224224 or
225225 i = 1 and result = super .getIndex ( )
@@ -230,7 +230,7 @@ class IndexExprTree extends StandardPostOrderTree instanceof IndexExpr {
230230// dominating successors in the graph in the same way that patterns do in
231231// `match` expressions.
232232class LetExprTree extends StandardPreOrderTree instanceof LetExpr {
233- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getPat ( ) }
233+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getPat ( ) }
234234}
235235
236236// We handle `let` statements with trivial patterns separately as they don't
@@ -239,7 +239,7 @@ class LetExprTree extends StandardPreOrderTree instanceof LetExpr {
239239class LetStmtTreeTrivialPat extends StandardPreOrderTree instanceof LetStmt {
240240 LetStmtTreeTrivialPat ( ) { trivialPat ( super .getPat ( ) ) }
241241
242- override ControlFlowTree getChildNode ( int i ) {
242+ override AstNode getChildNode ( int i ) {
243243 i = 0 and result = super .getInitializer ( )
244244 or
245245 i = 1 and result = super .getPat ( )
@@ -370,7 +370,7 @@ class MatchExprTree extends PostOrderTree instanceof MatchExpr {
370370}
371371
372372class MethodCallExprTree extends StandardPostOrderTree instanceof MethodCallExpr {
373- override ControlFlowTree getChildNode ( int i ) {
373+ override AstNode getChildNode ( int i ) {
374374 result = super .getReceiver ( ) and
375375 result = super .getArgList ( ) .getArg ( i + 1 )
376376 }
@@ -379,7 +379,7 @@ class MethodCallExprTree extends StandardPostOrderTree instanceof MethodCallExpr
379379class OffsetOfExprTree extends LeafTree instanceof OffsetOfExpr { }
380380
381381class ParenExprTree extends StandardPostOrderTree , ParenExpr {
382- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
382+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
383383}
384384
385385// This covers all patterns as they all extend `Pat`
@@ -388,25 +388,25 @@ class PatExprTree extends LeafTree instanceof Pat { }
388388class PathExprTree extends LeafTree instanceof PathExpr { }
389389
390390class PrefixExprTree extends StandardPostOrderTree instanceof PrefixExpr {
391- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
391+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
392392}
393393
394394class RangeExprTree extends StandardPostOrderTree instanceof RangeExpr {
395- override ControlFlowTree getChildNode ( int i ) {
395+ override AstNode getChildNode ( int i ) {
396396 i = 0 and result = super .getStart ( )
397397 or
398398 i = 1 and result = super .getEnd ( )
399399 }
400400}
401401
402402class RecordExprTree extends StandardPostOrderTree instanceof RecordExpr {
403- override ControlFlowTree getChildNode ( int i ) {
403+ override AstNode getChildNode ( int i ) {
404404 result = super .getRecordExprFieldList ( ) .getField ( i ) .getExpr ( )
405405 }
406406}
407407
408408class RefExprTree extends StandardPostOrderTree instanceof RefExpr {
409- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
409+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
410410}
411411
412412class ReturnExprTree extends PostOrderTree instanceof ReturnExpr {
@@ -424,7 +424,7 @@ class ReturnExprTree extends PostOrderTree instanceof ReturnExpr {
424424}
425425
426426class TupleExprTree extends StandardPostOrderTree instanceof TupleExpr {
427- override ControlFlowTree getChildNode ( int i ) { result = super .getField ( i ) }
427+ override AstNode getChildNode ( int i ) { result = super .getField ( i ) }
428428}
429429
430430class TypeRefTree extends LeafTree instanceof TypeRef { }
@@ -433,10 +433,10 @@ class UnderscoreExprTree extends LeafTree instanceof UnderscoreExpr { }
433433
434434// NOTE: `yield` is a reserved but unused keyword.
435435class YieldExprTree extends StandardPostOrderTree instanceof YieldExpr {
436- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
436+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
437437}
438438
439439// NOTE: `yeet` is experimental and not a part of Rust.
440440class YeetExprTree extends StandardPostOrderTree instanceof YeetExpr {
441- override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
441+ override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
442442}
0 commit comments