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

Class Public::Node

A node in a data flow graph.

A node can be either an IR instruction or an SSA definition. Such nodes are created with DataFlow::instructionNode and DataFlow::ssaNode respectively.

Import path

import semmle.go.dataflow.internal.DataFlowNodes

Direct supertypes

Known direct subtypes

Predicates

asExpr

Gets the expression corresponding to this node, if any.

asInstruction

Gets the IR instruction corresponding to this node, if any.

asParameter

Gets the parameter corresponding to this node, if any.

getAPredecessor

Gets a data-flow node from which data may flow to this node in one (intra-procedural) step.

getASuccessor

Gets a data-flow node to which data may flow from this node in one (intra-procedural) step.

getBasicBlock

Gets the basic block to which this data-flow node belongs, if any.

getBoolValue

Gets the Boolean value this data-flow node contains, if any.

getEnclosingCallable

INTERNAL: Use getRoot() instead.

getEndColumn

Gets the end column of the location of this node.

getEndLine

Gets the end line of the location of this node.

getExactValue

Gets the string representation of the exact value this data-flow node contains, if any.

getFile

Gets the file in which this node appears.

getFloatValue

Gets the floating-point value this data-flow node contains, if any.

getIntValue

Gets the integer value this data-flow node contains, if any.

getLocation

Gets the location of this node.

getNodeKind

Gets a textual representation of the kind of this data-flow node.

getNumericValue

Gets either getFloatValue or getIntValue.

getRoot

Gets the function to which this node belongs.

getStartColumn

Gets the start column of the location of this node.

getStartLine

Gets the start line of the location of this node.

getStringValue

Gets the string value this data-flow node contains, if any.

getType

Gets the type of this node.

getTypeBound

Gets an upper bound on the type of this node.

hasComplexValue

Holds if the complex value this data-flow node contains has real part real and imaginary part imag.

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.

isConst

Holds if the value of this data-flow node is known at compile time.

isPlatformIndependentConstant

Holds if the result of this instruction is known at compile time, and is guaranteed not to depend on the platform where it is evaluated.

toString

Gets a textual representation of this element.