CodeQL library for C/C++
codeql/cpp-all 1.1.0 (changelog, source)

Module ControlFlowGraph

Provides a library for reasoning about control flow at the granularity of individual nodes in the control-flow graph.

Import path

import semmle.code.cpp.controlflow.ControlFlowGraph



Provides a library for reasoning about control flow at the granularity of basic blocks. This is usually much more efficient than reasoning directly at the level of ControlFlowNodes.


Provides predicates that should be exported as if they were top-level predicates in ControlFlowGraph.qll. They have to be defined in this file in order to be grouped in a cached module with other predicates that must go in the same cached stage.


Provides classes and predicates for working with C/C++ code.



Holds if there is a control-flow edge from source to target in either the extractor-generated control-flow graph or in a subclass of AdditionalControlFlowEdge. Use this relation instead of qlCFGSuccessor.



An abstract class that can be extended to add additional edges to the control-flow graph. Instances of this class correspond to the source nodes of such edges, and the predicate getAnEdgeTarget should be overridden to produce the target nodes of each source.


A control-flow node is either a statement or an expression; in addition, functions are control-flow nodes representing the exit point of the function. The graph represents one possible evaluation order out of all the ones the compiler might have picked.


An element that is convertible to ControlFlowNode. This class is similar to ControlFlowNode except that is has no member predicates apart from toString.