Class CFGTranslationPhaseThree
java.lang.Object
org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseThree
Class that performs phase three of the translation process. In particular, the following
degenerate cases of basic blocks are removed:
- Empty regular basic blocks: These blocks will be removed and their predecessors linked directly to the successor.
- Conditional basic blocks that have the same basic block as the 'then' and 'else' successor: The conditional basic block will be removed in this case.
- Two consecutive, non-empty, regular basic blocks where the second block has exactly one predecessor (namely the other of the two blocks): In this case, the two blocks are merged.
- Some basic blocks might not be reachable from the entryBlock. These basic blocks are removed, and the list of predecessors (in the doubly-linked structure of basic blocks) are adapted correctly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA simple wrapper object that holds a basic block and allows to set one of its successors. -
Method Summary
Modifier and TypeMethodDescriptionstatic ControlFlowGraphprocess(ControlFlowGraph cfg) Perform phase three on the control flow graphcfg.
-
Method Details
-
process
Perform phase three on the control flow graphcfg.- Parameters:
cfg- the control flow graph. Ownership is transferred to this method and the caller is not allowed to read or modifycfgafter the call toprocessany more.- Returns:
- the resulting control flow graph
-