CodeQL library for Go
codeql/go-all 2.1.3 (changelog, source)
Search

Class ControlFlow::Node

A node in the intra-procedural control-flow graph of a Go function or file.

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 function and file that mark the beginning and the end, respectively, of the execution of the function and the loading of the file.

Import path

import semmle.go.controlflow.ControlFlowGraph

Direct supertypes

Known direct subtypes

Predicates

dominatesNode

Holds if this node dominates dominee in the control-flow graph.

getAPredecessor

Gets a node that directly precedes this one in the control-flow graph.

getASuccessor

Gets a node that directly follows this one in the control-flow graph.

getBasicBlock

Gets the basic block to which this node belongs.

getFile

Gets the file to which this node belongs.

getRoot

Gets the innermost function or file to which this node belongs.

hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

isBranch

Holds if this is a node with more than one successor.

isEntryNode

Holds if this node is the (unique) entry node of a function or file.

isExitNode

Holds if this node is the (unique) exit node of a function or file.

isFirstNodeOf

Holds if this is the first control-flow node in subtree.

isJoin

Holds if this is a node with more than one predecessor.

toString

Gets a textual representation of this control flow node.