|
Nearly CC
An educational compiler skeleton
|
ControlFlowGraphBuilder builds a ControlFlowGraph from an InstructionSequence. More...
#include "cfg_builder.h"
Public Member Functions | |
| ControlFlowGraphBuilder (const std::shared_ptr< InstructionSequence > &iseq) | |
| Constuctor. More... | |
| std::shared_ptr< ControlFlowGraph > | build () |
| Build a ControlFlowGraph from the original InstructionSequence. More... | |
| virtual bool | is_branch (Instruction *ins) |
| Subclasses may override this method to specify which Instructions are branches (i.e., have a control successor other than the next instruction in the original InstructionSequence). More... | |
ControlFlowGraphBuilder builds a ControlFlowGraph from an InstructionSequence.
It is templated by InstructionProperties, which should be either HighLevelInstructionProperties or LowLevelInstructionProperties, depending on whether you're building a high-level or low-level control-flow graph.
| InstructionProperties | either HighLevelInstructionProperties or LowLevelInstructionProperties, depending on whether the InstructionSequence has high-level or low-level instructions |
| ControlFlowGraphBuilder< InstructionProperties >::ControlFlowGraphBuilder | ( | const std::shared_ptr< InstructionSequence > & | iseq | ) |
Constuctor.
| iseq | the InstructionSequence containing the instructions to build |
| std::shared_ptr< ControlFlowGraph > ControlFlowGraphBuilder< InstructionProperties >::build |
Build a ControlFlowGraph from the original InstructionSequence.
|
virtual |
Subclasses may override this method to specify which Instructions are branches (i.e., have a control successor other than the next instruction in the original InstructionSequence).
The default implementation assumes that any Instruction with an operand of type Operand::LABEL is a branch.
| ins | the Instruction to check |