Nearly CC
An educational compiler skeleton
Public Member Functions | List of all members
ForwardNavigation Class Reference

Forward navigation in the control-flow graph (from predecessors towards successors). More...

#include "dataflow.h"

Public Member Functions

std::shared_ptr< InstructionSequenceget_start_block (const std::shared_ptr< ControlFlowGraph > &cfg) const
 Get the "start" block in the ControlFlowGraph, which for a forward analysis is the entry block. More...
 
const ControlFlowGraph::EdgeListget_edges (const std::shared_ptr< ControlFlowGraph > &cfg, std::shared_ptr< InstructionSequence > bb) const
 Get the control edges for a given block which lead to the "logical successors" of the block. More...
 
std::shared_ptr< InstructionSequenceget_block (const Edge *edge) const
 Get the basic block that is a "logical" successor from an Edge returned from the get_edges member function. More...
 

Detailed Description

Forward navigation in the control-flow graph (from predecessors towards successors).

This is used for forward analyses.

Member Function Documentation

◆ get_block()

std::shared_ptr<InstructionSequence> ForwardNavigation::get_block ( const Edge edge) const
inline

Get the basic block that is a "logical" successor from an Edge returned from the get_edges member function.

For forward analysis, the returned block is the target block.

Parameters
edgean Edge returned from get_edges()
Returns
the Edge's target block

◆ get_edges()

const ControlFlowGraph::EdgeList& ForwardNavigation::get_edges ( const std::shared_ptr< ControlFlowGraph > &  cfg,
std::shared_ptr< InstructionSequence bb 
) const
inline

Get the control edges for a given block which lead to the "logical successors" of the block.

For a forward analysis, these are the outgoing edges leading to the actual successors.

Parameters
cfgthe ControlFlowGraph
bbthe basic block
Returns
the edges leading to successors

◆ get_start_block()

std::shared_ptr<InstructionSequence> ForwardNavigation::get_start_block ( const std::shared_ptr< ControlFlowGraph > &  cfg) const
inline

Get the "start" block in the ControlFlowGraph, which for a forward analysis is the entry block.

Parameters
cfgthe ControlFlowGraph
Returns
a shared pointer to the start block

The documentation for this class was generated from the following file: