Skip to content

Commit

Permalink
Rearrange member predicates in ControlFlow::Node
Browse files Browse the repository at this point in the history
Put all the ones which might need to be overrridden by subclasses
together for ease of reading.
  • Loading branch information
owen-mc committed Nov 15, 2024
1 parent efb22d9 commit 86804e2
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions java/ql/lib/semmle/code/java/ControlFlowGraph.qll
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
abstract Callable getEnclosingCallable();

/** 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) }

Expand All @@ -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. */
abstract Callable getEnclosingCallable();

/** 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. */
abstract string toString();

Expand Down

0 comments on commit 86804e2

Please sign in to comment.