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

Datatype TControlFlowNode

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

There are two kinds of control-flow nodes:

  1. Instructions: these are nodes that correspond to expressions and statements that compute a value or perform an operation (as opposed to providing syntactic structure or type information).
  2. Synthetic nodes:
    • 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;
    • Skip nodes that are semantic no-ops, but make CFG construction easier.

Import path

import semmle.go.controlflow.ControlFlowGraphImpl

Known direct subtypes

Branch types

MkArgumentNode

A control-flow node that represents the argument corresponding to a parameter.

MkAssignNode

A control-flow node that represents a (single) assignment.

MkCaseCheckNode

A control-flow node that represents the implicit comparison or type check performed by the ith expression of a case clause cc.

MkCompoundAssignRhsNode

A control-flow node that represents the implicit right-hand side of a compound assignment.

MkConditionGuardNode

A control-flow node that represents the fact that e is known to evaluate to outcome.

MkDeferNode

A control-flow node that represents a defer statement.

MkEntryNode

A control-flow node that represents the start of the execution of a function or file.

MkExitNode

A control-flow node that represents the end of the execution of a function or file.

MkExprNode

A control-flow node that represents the evaluation of an expression.

MkExtractNode

A control-flow node that represents the ith component of a tuple expression s.

MkFuncDeclNode

A control-flow node that represents a function declaration.

MkGoNode

A control-flow node that represents a go statement.

MkImplicitDeref

A control-flow node that represents the implicit dereference of the base in a field/method access, element access, or slice expression.

MkImplicitFieldSelection

A control-flow node that represents the implicit selection of a field when accessing a promoted field.

MkImplicitLiteralElementIndex

A control-flow node that represents the implicit index of an element in a slice or array literal.

MkImplicitLowerSliceBound

A control-flow node that represents the implicit lower bound of a slice expression.

MkImplicitMaxSliceBound

A control-flow node that represents the implicit max bound of a simple slice expression.

MkImplicitOne

A control-flow node that represents the implicit operand 1 of an increment or decrement statement.

MkImplicitTrue

A control-flow node that represents the implicit true expression in switch { ... }.

MkImplicitUpperSliceBound

A control-flow node that represents the implicit upper bound of a simple slice expression.

MkIncDecNode

A control-flow node that represents an increment or decrement statement.

MkIncDecRhs

A control-flow node that represents the implicit right-hand side of an increment or decrement statement.

MkLiteralElementInitNode

A control-flow node that represents the initialization of an element of a composite literal.

MkNextNode

A control-flow node that represents the operation of retrieving the next (key, value) pair in a range statement, if any.

MkParameterInit

A control-flow node that represents the initialization of a parameter to its corresponding argument.

MkResultInit

A control-flow node that represents the initialization of a result variable to its zero value.

MkResultReadNode

A control-flow node that represents the implicit read of a named result variable upon returning from a function (after any deferred calls have been executed).

MkResultWriteNode

A control-flow node that represents the implicit write to a named result variable in a return statement.

MkReturnNode

A control-flow node that represents a return from a function.

MkSelectNode

A control-flow node that represents a select operation.

MkSendNode

A control-flow node that represents a send operation.

MkSkipNode

A control-flow node that represents a no-op.

MkTypeSwitchImplicitVariable

A control-flow node that represents the implicit declaration of the variable lv in case clause cc and its assignment of the value switchExpr from the guard. This only occurs in case clauses in a type switch statement which declares a variable in its guard.

MkZeroInitNode

A control-flow node that represents the zero value to which a variable without an initializer expression is initialized.

Injectors

MkArgumentNode

A control-flow node that represents the argument corresponding to a parameter.

MkAssignNode

A control-flow node that represents a (single) assignment.

MkCaseCheckNode

A control-flow node that represents the implicit comparison or type check performed by the ith expression of a case clause cc.

MkCompoundAssignRhsNode

A control-flow node that represents the implicit right-hand side of a compound assignment.

MkConditionGuardNode

A control-flow node that represents the fact that e is known to evaluate to outcome.

MkDeferNode

A control-flow node that represents a defer statement.

MkEntryNode

A control-flow node that represents the start of the execution of a function or file.

MkExitNode

A control-flow node that represents the end of the execution of a function or file.

MkExprNode

A control-flow node that represents the evaluation of an expression.

MkExtractNode

A control-flow node that represents the ith component of a tuple expression s.

MkFuncDeclNode

A control-flow node that represents a function declaration.

MkGoNode

A control-flow node that represents a go statement.

MkImplicitDeref

A control-flow node that represents the implicit dereference of the base in a field/method access, element access, or slice expression.

MkImplicitFieldSelection

A control-flow node that represents the implicit selection of a field when accessing a promoted field.

MkImplicitLiteralElementIndex

A control-flow node that represents the implicit index of an element in a slice or array literal.

MkImplicitLowerSliceBound

A control-flow node that represents the implicit lower bound of a slice expression.

MkImplicitMaxSliceBound

A control-flow node that represents the implicit max bound of a simple slice expression.

MkImplicitOne

A control-flow node that represents the implicit operand 1 of an increment or decrement statement.

MkImplicitTrue

A control-flow node that represents the implicit true expression in switch { ... }.

MkImplicitUpperSliceBound

A control-flow node that represents the implicit upper bound of a simple slice expression.

MkIncDecNode

A control-flow node that represents an increment or decrement statement.

MkIncDecRhs

A control-flow node that represents the implicit right-hand side of an increment or decrement statement.

MkLiteralElementInitNode

A control-flow node that represents the initialization of an element of a composite literal.

MkNextNode

A control-flow node that represents the operation of retrieving the next (key, value) pair in a range statement, if any.

MkParameterInit

A control-flow node that represents the initialization of a parameter to its corresponding argument.

MkResultInit

A control-flow node that represents the initialization of a result variable to its zero value.

MkResultReadNode

A control-flow node that represents the implicit read of a named result variable upon returning from a function (after any deferred calls have been executed).

MkResultWriteNode

A control-flow node that represents the implicit write to a named result variable in a return statement.

MkReturnNode

A control-flow node that represents a return from a function.

MkSelectNode

A control-flow node that represents a select operation.

MkSendNode

A control-flow node that represents a send operation.

MkSkipNode

A control-flow node that represents a no-op.

MkTypeSwitchImplicitVariable

A control-flow node that represents the implicit declaration of the variable lv in case clause cc and its assignment of the value switchExpr from the guard. This only occurs in case clauses in a type switch statement which declares a variable in its guard.

MkZeroInitNode

A control-flow node that represents the zero value to which a variable without an initializer expression is initialized.