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

Backward navigation in the control-flow graph (from successors back to predecessors). 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 backward analysis is the exit 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

Backward navigation in the control-flow graph (from successors back to predecessors).

This is used for backward analyses.

Member Function Documentation

◆ get_block()

std::shared_ptr<InstructionSequence> BackwardNavigation::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 backward analysis, the returned block is the source block.

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

◆ get_edges()

const ControlFlowGraph::EdgeList& BackwardNavigation::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 backward analysis, these are the incoming edges leading to the actual predecessors.

Parameters
cfgthe ControlFlowGraph
bbthe basic block
Returns
the edges coming from predecessors

◆ get_start_block()

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

Get the "start" block in the ControlFlowGraph, which for a backward analysis is the exit block.

Parameters
cfgthe ControlFlowGraph
Returns
a shared pointer to the exit block

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