@@ -60,7 +60,7 @@ private cached module Cached {
6060 private predicate non_primitive_basic_block_entry_node ( ControlFlowNode node ) {
6161 not primitive_basic_block_entry_node ( node ) and
6262 not exists ( node .getAPredecessor ( ) ) and
63- successors_extended ( unresolveElement ( node ) , _)
63+ successors_extended ( node , _)
6464 }
6565
6666 /**
@@ -80,7 +80,7 @@ private cached module Cached {
8080 * reuse predicates already computed for `PrimitiveBasicBlocks`.
8181 */
8282 private predicate equalsPrimitiveBasicBlock ( BasicBlock bb ) {
83- primitive_basic_block_entry_node ( mkElement ( bb ) )
83+ primitive_basic_block_entry_node ( bb )
8484 and
8585 not exists ( int i |
8686 i > 0 and
@@ -96,11 +96,11 @@ private cached module Cached {
9696 }
9797
9898 private predicate non_primitive_basic_block_member ( ControlFlowNode node , BasicBlock bb , int pos ) {
99- ( not equalsPrimitiveBasicBlock ( bb ) and node = mkElement ( bb ) and pos = 0 )
99+ ( not equalsPrimitiveBasicBlock ( bb ) and node = bb and pos = 0 )
100100 or
101- ( not ( unresolveElement ( node ) instanceof BasicBlock ) and
101+ ( not ( node instanceof BasicBlock ) and
102102 exists ( ControlFlowNode pred
103- | successors_extended ( unresolveElement ( pred ) , unresolveElement ( node ) )
103+ | successors_extended ( pred , node )
104104 | non_primitive_basic_block_member ( pred , bb , pos - 1 ) ) )
105105 }
106106
@@ -117,7 +117,7 @@ private cached module Cached {
117117 predicate bb_successor_cached ( BasicBlock pred , BasicBlock succ ) {
118118 exists ( ControlFlowNode last |
119119 basic_block_member ( last , pred , bb_length ( pred ) - 1 ) and
120- last .getASuccessor ( ) = mkElement ( succ )
120+ last .getASuccessor ( ) = succ
121121 )
122122 }
123123}
@@ -143,15 +143,10 @@ predicate bb_successor = bb_successor_cached/2;
143143 * A - B < C - D AB is a basic block and CD is a basic block (B has two outgoing edges)
144144 * ```
145145 */
146- class BasicBlock extends @cfgnode {
146+ class BasicBlock extends ControlFlowNodeBase {
147147
148148 BasicBlock ( ) {
149- basic_block_entry_node ( mkElement ( this ) )
150- }
151-
152- /** Gets a textual representation of this element. */
153- string toString ( ) {
154- result = "BasicBlock"
149+ basic_block_entry_node ( this )
155150 }
156151
157152 predicate contains ( ControlFlowNode node ) {
@@ -187,7 +182,7 @@ class BasicBlock extends @cfgnode {
187182 }
188183
189184 ControlFlowNode getStart ( ) {
190- result = mkElement ( this )
185+ result = this
191186 }
192187
193188 /** Gets the number of `ControlFlowNode`s in this basic block. */
@@ -248,9 +243,9 @@ class BasicBlock extends @cfgnode {
248243 * point or a `catch` clause of a reachable `try` statement.
249244 */
250245 predicate isReachable ( ) {
251- exists ( Function f | f .getBlock ( ) = mkElement ( this ) )
246+ exists ( Function f | f .getBlock ( ) = this )
252247 or
253- exists ( TryStmt t , BasicBlock tryblock | mkElement ( this ) = t .getACatchClause ( ) and tryblock .isReachable ( ) and tryblock .contains ( t ) )
248+ exists ( TryStmt t , BasicBlock tryblock | this = t .getACatchClause ( ) and tryblock .isReachable ( ) and tryblock .contains ( t ) )
254249 or
255250 exists ( BasicBlock pred | pred .getASuccessor ( ) = this and pred .isReachable ( ) )
256251 }
@@ -272,7 +267,7 @@ predicate unreachable(ControlFlowNode n) {
272267 */
273268class EntryBasicBlock extends BasicBlock {
274269 EntryBasicBlock ( ) {
275- exists ( Function f | mkElement ( this ) = f .getEntryPoint ( ) )
270+ exists ( Function f | this = f .getEntryPoint ( ) )
276271 }
277272}
278273
0 commit comments