Rearrange member predicates in ControlFlow::Node

Put all the ones which might need to be overrridden by subclasses
together for ease of reading.
This commit is contained in:
Owen Mansel-Chan
2024-11-15 11:21:58 +00:00
parent 79f4f78fc2
commit aaa4361120

View File

@@ -104,21 +104,6 @@ module ControlFlow {
/** A node in the expression-level control-flow graph. */
class Node extends TNode {
/** Gets the statement containing this node, if any. */
Stmt getEnclosingStmt() { none() }
/** Gets the immediately enclosing callable whose body contains this node. */
Callable getEnclosingCallable() { none() }
/** Gets the statement this `Node` corresponds to, if any. */
Stmt asStmt() { none() }
/** Gets the expression this `Node` corresponds to, if any. */
Expr asExpr() { none() }
/** Gets the call this `Node` corresponds to, if any. */
Call asCall() { none() }
/** Gets an immediate successor of this node. */
Node getASuccessor() { result = succ(this) }
@@ -137,6 +122,21 @@ module ControlFlow {
/** Gets the basic block that contains this node. */
BasicBlock getBasicBlock() { result.getANode() = this }
/** Gets the statement containing this node, if any. */
Stmt getEnclosingStmt() { none() }
/** Gets the immediately enclosing callable whose body contains this node. */
Callable getEnclosingCallable() { none() }
/** Gets the statement this `Node` corresponds to, if any. */
Stmt asStmt() { none() }
/** Gets the expression this `Node` corresponds to, if any. */
Expr asExpr() { none() }
/** Gets the call this `Node` corresponds to, if any. */
Call asCall() { none() }
/** Gets a textual representation of this element. */
string toString() { none() }