CodeQL library for Java/Kotlin
codeql/java-all 9.0.2 (changelog, source)
Search

Module ControlFlowGraph

Provides a shared implementation of control flow graphs (CFGs).

The implementation is built on a common AST signature, which contains many AST constructs that are common across languages. Language-specific AST constructs can be given control flow semantics separately and seamlessly integrated into the shared CFG. Any parts of the AST without explicit control flow semantics will be given a default left-to-right evaluation order with an option to choose between pre-order and post-order. By default, most expressions are evaluated in post-order, while most statements are evaluated in pre-order, but there are several exceptions to this.

Control flow nodes are synthesized such that each AST node is represented by a unique control flow node. Each AST node also gets associated “before” and “after” control flow nodes, which represent the points in the control flow before and after the normal execution of the AST node, respectively. For simple leaf nodes, the “before” and “after” nodes are merged into a single node. For AST nodes in conditional contexts, there are two different “after” nodes representing the different possible values of the AST node.

Import path

import codeql.controlflow.ControlFlowGraph

Modules

Make0

Constructs the initial setup for a control flow graph. The construction is completed by subsequent instatiation of Make1 and Make2.

Type signatures

Module signatures