@@ -46,7 +46,7 @@ class ExprCfgNode extends AstCfgNode {
46
46
47
47
Expr e ;
48
48
49
- ExprCfgNode ( ) { e = this .getNode ( ) }
49
+ ExprCfgNode ( ) { e = this .getAstNode ( ) }
50
50
51
51
/** Gets the underlying expression. */
52
52
Expr getExpr ( ) { result = e }
@@ -61,30 +61,32 @@ class ReturningCfgNode extends AstCfgNode {
61
61
62
62
ReturningStmt s ;
63
63
64
- ReturningCfgNode ( ) { s = this .getNode ( ) }
64
+ ReturningCfgNode ( ) { s = this .getAstNode ( ) }
65
65
66
66
/** Gets the node of the returned value, if any. */
67
67
ExprCfgNode getReturnedValueNode ( ) {
68
68
result = this .getAPredecessor ( ) and
69
- result .getNode ( ) = s .getValue ( )
69
+ result .getAstNode ( ) = s .getValue ( )
70
70
}
71
71
}
72
72
73
73
/** A control-flow node that wraps a `StringComponent` AST expression. */
74
74
class StringComponentCfgNode extends AstCfgNode {
75
75
override string getAPrimaryQlClass ( ) { result = "StringComponentCfgNode" }
76
76
77
- StringComponentCfgNode ( ) { this .getNode ( ) instanceof StringComponent }
77
+ StringComponentCfgNode ( ) { this .getAstNode ( ) instanceof StringComponent }
78
78
79
79
/** Gets the constant value of this string component. */
80
- ConstantValue getConstantValue ( ) { result = this .getNode ( ) .( StringComponent ) .getConstantValue ( ) }
80
+ ConstantValue getConstantValue ( ) {
81
+ result = this .getAstNode ( ) .( StringComponent ) .getConstantValue ( )
82
+ }
81
83
}
82
84
83
85
/** A control-flow node that wraps a `RegExpComponent` AST expression. */
84
86
class RegExpComponentCfgNode extends StringComponentCfgNode {
85
87
override string getAPrimaryQlClass ( ) { result = "RegExpComponentCfgNode" }
86
88
87
- RegExpComponentCfgNode ( ) { this .getNode ( ) instanceof RegExpComponent }
89
+ RegExpComponentCfgNode ( ) { this .getAstNode ( ) instanceof RegExpComponent }
88
90
}
89
91
90
92
private AstNode desugar ( AstNode n ) {
@@ -117,7 +119,7 @@ abstract private class ChildMapping extends AstNode {
117
119
cached
118
120
predicate hasCfgChild ( AstNode child , CfgNode cfn , CfgNode cfnChild ) {
119
121
this .reachesBasicBlock ( child , cfn , cfnChild .getBasicBlock ( ) ) and
120
- cfnChild .getNode ( ) = desugar ( child )
122
+ cfnChild .getAstNode ( ) = desugar ( child )
121
123
}
122
124
}
123
125
@@ -134,7 +136,7 @@ abstract private class ExprChildMapping extends Expr, ChildMapping {
134
136
exists ( BasicBlock mid |
135
137
this .reachesBasicBlock ( child , cfn , mid ) and
136
138
bb = mid .getAPredecessor ( ) and
137
- not mid .getANode ( ) .getNode ( ) = child
139
+ not mid .getANode ( ) .getAstNode ( ) = child
138
140
)
139
141
}
140
142
}
@@ -148,13 +150,13 @@ abstract private class NonExprChildMapping extends ChildMapping {
148
150
pragma [ nomagic]
149
151
override predicate reachesBasicBlock ( AstNode child , CfgNode cfn , BasicBlock bb ) {
150
152
this .relevantChild ( child ) and
151
- cfn .getNode ( ) = this and
153
+ cfn .getAstNode ( ) = this and
152
154
bb .getANode ( ) = cfn
153
155
or
154
156
exists ( BasicBlock mid |
155
157
this .reachesBasicBlock ( child , cfn , mid ) and
156
158
bb = mid .getASuccessor ( ) and
157
- not mid .getANode ( ) .getNode ( ) = child
159
+ not mid .getANode ( ) .getAstNode ( ) = child
158
160
)
159
161
}
160
162
}
@@ -380,7 +382,7 @@ module ExprNodes {
380
382
class InClauseCfgNode extends AstCfgNode {
381
383
private InClauseChildMapping e ;
382
384
383
- InClauseCfgNode ( ) { e = this .getNode ( ) }
385
+ InClauseCfgNode ( ) { e = this .getAstNode ( ) }
384
386
385
387
override string getAPrimaryQlClass ( ) { result = "InClauseCfgNode" }
386
388
@@ -400,28 +402,28 @@ module ExprNodes {
400
402
predicate patternReachesBasicBlock ( int i , CfgNode cfnPattern , BasicBlock bb ) {
401
403
exists ( Expr pattern |
402
404
pattern = this .getPattern ( i ) and
403
- cfnPattern .getNode ( ) = pattern and
405
+ cfnPattern .getAstNode ( ) = pattern and
404
406
bb .getANode ( ) = cfnPattern
405
407
)
406
408
or
407
409
exists ( BasicBlock mid |
408
410
this .patternReachesBasicBlock ( i , cfnPattern , mid ) and
409
411
bb = mid .getASuccessor ( ) and
410
- not mid .getANode ( ) .getNode ( ) = this
412
+ not mid .getANode ( ) .getAstNode ( ) = this
411
413
)
412
414
}
413
415
414
416
predicate bodyReachesBasicBlock ( CfgNode cfnBody , BasicBlock bb ) {
415
417
exists ( Stmt body |
416
418
body = this .getBody ( ) and
417
- cfnBody .getNode ( ) = body and
419
+ cfnBody .getAstNode ( ) = body and
418
420
bb .getANode ( ) = cfnBody
419
421
)
420
422
or
421
423
exists ( BasicBlock mid |
422
424
this .bodyReachesBasicBlock ( cfnBody , mid ) and
423
425
bb = mid .getAPredecessor ( ) and
424
- not mid .getANode ( ) .getNode ( ) = this
426
+ not mid .getANode ( ) .getAstNode ( ) = this
425
427
)
426
428
}
427
429
}
@@ -430,19 +432,19 @@ module ExprNodes {
430
432
class WhenClauseCfgNode extends AstCfgNode {
431
433
private WhenClauseChildMapping e ;
432
434
433
- WhenClauseCfgNode ( ) { e = this .getNode ( ) }
435
+ WhenClauseCfgNode ( ) { e = this .getAstNode ( ) }
434
436
435
437
override string getAPrimaryQlClass ( ) { result = "WhenClauseCfgNode" }
436
438
437
439
/** Gets the body of this `when`-clause. */
438
440
final ExprCfgNode getBody ( ) {
439
- result .getNode ( ) = desugar ( e .getBody ( ) ) and
441
+ result .getAstNode ( ) = desugar ( e .getBody ( ) ) and
440
442
e .bodyReachesBasicBlock ( result , this .getBasicBlock ( ) )
441
443
}
442
444
443
445
/** Gets the `i`th pattern this `when`-clause. */
444
446
final ExprCfgNode getPattern ( int i ) {
445
- result .getNode ( ) = desugar ( e .getPattern ( i ) ) and
447
+ result .getAstNode ( ) = desugar ( e .getPattern ( i ) ) and
446
448
e .patternReachesBasicBlock ( i , result , this .getBasicBlock ( ) )
447
449
}
448
450
}
@@ -451,7 +453,7 @@ module ExprNodes {
451
453
class CasePatternCfgNode extends AstCfgNode {
452
454
CasePattern e ;
453
455
454
- CasePatternCfgNode ( ) { e = this .getNode ( ) }
456
+ CasePatternCfgNode ( ) { e = this .getAstNode ( ) }
455
457
456
458
override string getAPrimaryQlClass ( ) { result = "CasePatternCfgNode" }
457
459
}
@@ -815,7 +817,7 @@ module ExprNodes {
815
817
816
818
/** A control-flow node that wraps an `InstanceVariableReadAccess` AST expression. */
817
819
class InstanceVariableReadAccessCfgNode extends InstanceVariableAccessCfgNode {
818
- InstanceVariableReadAccessCfgNode ( ) { this .getNode ( ) instanceof InstanceVariableReadAccess }
820
+ InstanceVariableReadAccessCfgNode ( ) { this .getAstNode ( ) instanceof InstanceVariableReadAccess }
819
821
820
822
override string getAPrimaryQlClass ( ) { result = "InstanceVariableReadAccessCfgNode" }
821
823
@@ -824,7 +826,9 @@ module ExprNodes {
824
826
825
827
/** A control-flow node that wraps an `InstanceVariableWriteAccess` AST expression. */
826
828
class InstanceVariableWriteAccessCfgNode extends InstanceVariableAccessCfgNode {
827
- InstanceVariableWriteAccessCfgNode ( ) { this .getNode ( ) instanceof InstanceVariableWriteAccess }
829
+ InstanceVariableWriteAccessCfgNode ( ) {
830
+ this .getAstNode ( ) instanceof InstanceVariableWriteAccess
831
+ }
828
832
829
833
override string getAPrimaryQlClass ( ) { result = "InstanceVariableWriteAccessCfgNode" }
830
834
@@ -835,7 +839,9 @@ module ExprNodes {
835
839
class StringInterpolationComponentCfgNode extends StringComponentCfgNode , StmtSequenceCfgNode {
836
840
override string getAPrimaryQlClass ( ) { result = "StringInterpolationComponentCfgNode" }
837
841
838
- StringInterpolationComponentCfgNode ( ) { this .getNode ( ) instanceof StringInterpolationComponent }
842
+ StringInterpolationComponentCfgNode ( ) {
843
+ this .getAstNode ( ) instanceof StringInterpolationComponent
844
+ }
839
845
840
846
final override ConstantValue getConstantValue ( ) {
841
847
result = StmtSequenceCfgNode .super .getConstantValue ( )
@@ -846,7 +852,9 @@ module ExprNodes {
846
852
class RegExpInterpolationComponentCfgNode extends RegExpComponentCfgNode , StmtSequenceCfgNode {
847
853
override string getAPrimaryQlClass ( ) { result = "RegExpInterpolationComponentCfgNode" }
848
854
849
- RegExpInterpolationComponentCfgNode ( ) { this .getNode ( ) instanceof RegExpInterpolationComponent }
855
+ RegExpInterpolationComponentCfgNode ( ) {
856
+ this .getAstNode ( ) instanceof RegExpInterpolationComponent
857
+ }
850
858
851
859
final override ConstantValue getConstantValue ( ) {
852
860
result = StmtSequenceCfgNode .super .getConstantValue ( )
0 commit comments