Class ControlFlow::Node
A node in the control-flow graph of a Go file or function.
Nodes correspond to expressions and statements that compute a value or perform an operation (as opposed to providing syntactic structure or type information).
There are also synthetic entry and exit nodes for each Go file or function that mark the beginning and the end, respectively, of its execution.
Import path
import semmle.go.controlflow.ControlFlowGraphDirect supertypes
Known direct subtypes
Predicates
| dominatesNode | Holds if this node dominates |
| getFile | Gets the file to which this node belongs. |
| getRoot | Gets the innermost function to which this node belongs, or the file if it is not inside a function. |
| hasLocationInfo | DEPRECATED: Use |
| isBranch | Holds if this is a node with more than one successor. |
| isEntryNode | Holds if this node is the unique entry node of a file or function. |
| isExitNode | Holds if this node is the unique exit node of a file or function. |
| isFirstNodeOf | Holds if this is the first control-flow node in |
| isJoin | Holds if this is a node with more than one predecessor. |
Inherited predicates
| asExpr | Gets the expression this control flow node uniquely represents, if any. | from NodeImpl |
| asStmt | Gets the statement this control flow node uniquely represents, if any. | from NodeImpl |
| dominates | Holds if this node dominates | from ControlFlowNode |
| getANormalSuccessor | Gets a normal successor of this node, if any. This includes direct successors and conditional successors. | from ControlFlowNode |
| getAPredecessor | Gets an immediate predecessor of this node, if this is not an | from ControlFlowNode |
| getASuccessor | Gets an immediate successor of this node, if this is not an | from ControlFlowNode |
| getASuccessor | Gets an immediate successor of a given type, if any. | from ControlFlowNode |
| getAnExceptionSuccessor | Gets an exception successor of this node, if any. | from ControlFlowNode |
| getAstNode | Gets the AST node with which this control flow node is associated. Note that several control flow nodes are usually associated with the same AST node, but each control flow node is associated with a unique AST node. | from NodeImpl |
| getBasicBlock | Gets the basic block containing this control flow node. | from ControlFlowNode |
| getEnclosingCallable | Gets the enclosing callable of this control flow node. | from NodeImpl |
| getIdTag | INTERNAL: Do not use. | from NodeImpl |
| getLocation | Gets the source location for this node. | from NodeImpl |
| injects | Holds if this is the unique control flow node that represents the given AST node. | from NodeImpl |
| isAdditional | Holds if this is an additional control flow node with the given tag for the given AST node. | from NodeImpl |
| isAfter | Holds if this is a node representing the point in the control flow after the normal termination of | from NodeImpl |
| isAfterFalse | Holds if this node indicates that | from ControlFlowNode |
| isAfterTrue | Holds if this node indicates that | from ControlFlowNode |
| isAfterValue | Holds if this node indicates that | from ControlFlowNode |
| isBefore | Holds if this is the node representing the point in the control flow before the execution of | from NodeImpl |
| isIn | Holds if this is the node representing the given AST node when | from NodeImpl |
| postDominates | Holds if this node post-dominates | from ControlFlowNode |
| strictlyDominates | Holds if this node strictly dominates | from ControlFlowNode |
| strictlyPostDominates | Holds if this node strictly post-dominates | from ControlFlowNode |
| toString | Gets a textual representation of this node. | from NodeImpl |