@@ -164,8 +164,6 @@ module CfgImpl {
164164 not this = any ( Go:: SelectStmt sel ) .getBody ( )
165165 }
166166
167- override Stmt getStmt ( int n ) { result = Go:: BlockStmt .super .getStmt ( n ) }
168-
169167 Stmt getLastStmt ( ) {
170168 exists ( int last | result = this .getStmt ( last ) and not exists ( this .getStmt ( last + 1 ) ) )
171169 }
@@ -183,23 +181,11 @@ module CfgImpl {
183181 Expr getExpr ( ) { result = Go:: ExprStmt .super .getExpr ( ) }
184182 }
185183
186- class IfStmt extends Stmt {
187- IfStmt ( ) { this instanceof Go:: IfStmt }
188-
189- Expr getCondition ( ) { result = this .( Go:: IfStmt ) .getCond ( ) }
190-
191- Stmt getThen ( ) { result = this .( Go:: IfStmt ) .getThen ( ) }
192-
193- Stmt getElse ( ) { result = this .( Go:: IfStmt ) .getElse ( ) }
194- }
184+ class IfStmt = Go:: IfStmt ;
195185
196186 AstNode getIfInit ( IfStmt ifstmt ) { result = ifstmt .( Go:: IfStmt ) .getInit ( ) }
197187
198- class LoopStmt extends Stmt {
199- LoopStmt ( ) { this instanceof Go:: LoopStmt }
200-
201- Stmt getBody ( ) { result = this .( Go:: LoopStmt ) .getBody ( ) }
202- }
188+ class LoopStmt = Go:: LoopStmt ;
203189
204190 class WhileStmt extends LoopStmt {
205191 WhileStmt ( ) { none ( ) }
@@ -219,19 +205,15 @@ module CfgImpl {
219205 Expr getCondition ( ) { none ( ) }
220206 }
221207
222- class ForStmt extends LoopStmt {
223- ForStmt ( ) { this instanceof Go:: ForStmt }
224-
208+ class ForStmt extends LoopStmt instanceof Go:: ForStmt {
225209 AstNode getInit ( int index ) { index = 0 and result = this .( Go:: ForStmt ) .getInit ( ) }
226210
227211 Expr getCondition ( ) { result = this .( Go:: ForStmt ) .getCond ( ) }
228212
229213 AstNode getUpdate ( int index ) { index = 0 and result = this .( Go:: ForStmt ) .getPost ( ) }
230214 }
231215
232- class ForeachStmt extends LoopStmt {
233- ForeachStmt ( ) { this instanceof Go:: RangeStmt }
234-
216+ class ForeachStmt extends LoopStmt instanceof Go:: RangeStmt {
235217 // Go's `range` statement binds its key and value by destructuring the
236218 // current element. The extractor synthesizes a single "range element"
237219 // node grouping the key and value (see `Go::RangeElementExpr`), which we
@@ -249,9 +231,7 @@ module CfgImpl {
249231
250232 class GotoStmt = Go:: GotoStmt ;
251233
252- class ReturnStmt extends Go:: ReturnStmt {
253- override Expr getExpr ( ) { result = Go:: ReturnStmt .super .getExpr ( ) }
254- }
234+ class ReturnStmt = Go:: ReturnStmt ;
255235
256236 class Throw extends AstNode {
257237 Throw ( ) { none ( ) }
@@ -281,9 +261,7 @@ module CfgImpl {
281261 Stmt getBody ( ) { none ( ) }
282262 }
283263
284- class Switch extends AstNode {
285- Switch ( ) { this instanceof Go:: SwitchStmt }
286-
264+ class Switch extends AstNode instanceof Go:: SwitchStmt {
287265 Expr getExpr ( ) {
288266 result = this .( Go:: ExpressionSwitchStmt ) .getExpr ( )
289267 or
@@ -837,7 +815,7 @@ module CfgImpl {
837815 PreControlFlowNode source , PreControlFlowNode target , AbruptCompletion completion
838816 ) {
839817 completion .getSuccessorType ( ) instanceof ExceptionSuccessor and
840- isExceptionalExitNode ( target ) and
818+ target instanceof ExceptionalExitNodeImpl and
841819 exists ( PreControlFlowNode nextDefer |
842820 deferExitStep ( source , nextDefer , _) and deferInvoke ( nextDefer , _)
843821 )
@@ -862,14 +840,8 @@ module CfgImpl {
862840 * Holds if `n` is the registration node of `defer` statement `s` (the
863841 * post-order node of the statement, reached once its call's arguments have
864842 * been evaluated).
865- *
866- * This uses the reachability-free `isInOrderNode` rather than `n.isIn(s)`
867- * because it is referenced under negation by `succBeforeNextDeferRegistration`, and must
868- * therefore not depend on `reachable`.
869843 */
870- private predicate deferRegistration ( PreControlFlowNode n , Go:: DeferStmt s ) {
871- isInOrderNode ( n , s )
872- }
844+ private predicate deferRegistration ( PreControlFlowNode n , Go:: DeferStmt s ) { n .isIn ( s ) }
873845
874846 /**
875847 * Holds if `n` is the deferred-invocation node for `defer` statement `s`,
0 commit comments