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:
- 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).
- 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.ControlFlowGraphImplKnown 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 |
| 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 |
| MkDeferNode | A control-flow node that represents a |
| 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 |
| MkFuncDeclNode | A control-flow node that represents a function declaration. |
| MkGoNode | A control-flow node that represents a |
| 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 |
| 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 |
| 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 |
| MkSendNode | A control-flow node that represents a |
| MkSkipNode | A control-flow node that represents a no-op. |
| MkTypeSwitchImplicitVariable | A control-flow node that represents the implicit declaration of the variable |
| 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 |
| 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 |
| MkDeferNode | A control-flow node that represents a |
| 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 |
| MkFuncDeclNode | A control-flow node that represents a function declaration. |
| MkGoNode | A control-flow node that represents a |
| 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 |
| 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 |
| 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 |
| MkSendNode | A control-flow node that represents a |
| MkSkipNode | A control-flow node that represents a no-op. |
| MkTypeSwitchImplicitVariable | A control-flow node that represents the implicit declaration of the variable |
| MkZeroInitNode | A control-flow node that represents the zero value to which a variable without an initializer expression is initialized. |