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

Module SubBasicBlocks

Provides the SubBasicBlock class, used for partitioning basic blocks in smaller pieces.

Import path

import semmle.code.cpp.controlflow.SubBasicBlocks



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



A block that can be smaller than or equal to a BasicBlock. Use this class when ControlFlowNode is too fine-grained and BasicBlock too coarse-grained. Their successor graph is like that of basic blocks, except that the blocks are split up with an extra edge right before any instance of the abstract class SubBasicBlockCutNode. Users of this library must therefore extend SubBasicBlockCutNode to direct where basic blocks will be split up.


An abstract class that directs where in the control-flow graph a new SubBasicBlock must start. If a ControlFlowNode is an instance of this class, that node is guaranteed to be the first node in a SubBasicBlock. If multiple libraries use the SubBasicBlock library, basic blocks may be split in more places than either library expects, but nothing should break as a direct result of that.