61 unsigned int _function_id,
const DesignFlowManagerConstRef _design_flow_manager)
73 switch(relationship_type)
77 relationships.insert(std::make_pair(BB_FEEDBACK_EDGES_IDENTIFICATION,
SAME_FUNCTION));
105 "-->Starting order computation on function " +
110 std::list<vertex> to_visit;
112 std::map<graph::vertex_descriptor, bool> MARK;
115 for(boost::tie(bb_v, bb_v_end) = boost::vertices(*ebb); bb_v != bb_v_end; ++bb_v)
120 to_visit.push_front(ebb->CGetBBGraphInfo()->entry_vertex);
122 while(!to_visit.empty())
124 vertex actual = to_visit.front();
126 "-->Checking vertex BB" + std::to_string(ebb->CGetBBNodeInfo(actual)->block->number));
127 to_visit.pop_front();
130 graph::out_edge_iterator o, o_end;
131 graph::in_edge_iterator i, i_end;
134 for(boost::tie(o, o_end) = boost::out_edges(actual, *ebb); o != o_end; o++)
139 "-->Checking successor vertex BB" + std::to_string(ebb->CGetBBNodeInfo(next)->block->number));
141 for(boost::tie(i, i_end) = boost::in_edges(next, *ebb); i != i_end; i++)
143 if(!MARK[boost::source(*i, *ebb)])
146 "---Checking its predecessor BB" +
147 std::to_string(ebb->CGetBBNodeInfo(boost::source(*i, *ebb))->block->number) +
153 "---Checking its predecessor BB" +
154 std::to_string(ebb->CGetBBNodeInfo(boost::source(*i, *ebb))->block->number) +
159 if(ebb->CGetBBEdgeInfo(*o)->cfg_edge_T())
166 to_visit.push_front(next);
173 to_visit.push_front(then);
179 const std::map<vertex, unsigned int>& bb_map_levels =
function_behavior->get_bb_map_levels();
180 if(bb_map_levels.find(ebb->CGetBBGraphInfo()->exit_vertex) == bb_map_levels.end())
~BBOrderComputation() override
Destructor.
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
File containing functions and utilities to support the printing of debug messagges.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Data structore used to build the topological order of the operations vertices.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
Basic block control flow graph with edges imposing that basic block inside a loop are executed before...
Data structure describing a basic block at tree level.
unsigned int bb_version
The version of the basic block intermediate representation on which this step has been applied...
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
Target must be reexecuted.
DesignFlowStep_Status InternalExec() override
Computes a topological order of the operations according to the control flow graph.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
boost::graph_traits< graph >::vertex_iterator VertexIterator
vertex_iterator definition.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
Class specification of the basic_block structure.
BBOrderComputation(const ParameterConstRef Param, const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
This file collects some hash functors.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
int debug_level
The debug level.
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
#define NULL_VERTEX
null vertex definition
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.