58 unsigned int _function_id,
const DesignFlowManagerConstRef _design_flow_manager)
70 switch(relationship_type)
74 relationships.insert(std::make_pair(BB_CONTROL_DEPENDENCE_COMPUTATION,
SAME_FUNCTION));
75 relationships.insert(std::make_pair(OPERATIONS_CFG_COMPUTATION,
SAME_FUNCTION));
76 relationships.insert(std::make_pair(OP_ORDER_COMPUTATION,
SAME_FUNCTION));
97 if(boost::num_vertices(*cdg) != 0)
100 for(boost::tie(edge, edge_end) =
boost::edges(*cdg); edge != edge_end; edge++)
113 for(boost::tie(edge, edge_end) =
boost::edges(*bb_cdg); edge != edge_end; edge++)
115 const auto source = boost::source(*edge, *bb_cdg);
117 const auto source_operations = bb_cdg->CGetBBNodeInfo(source)->statements_list;
118 const auto target_operations = bb_cdg->CGetBBNodeInfo(
target)->statements_list;
119 if(source_operations.size() and target_operations.size())
121 const auto labels = bb_cdg->CGetBBEdgeInfo(*edge)->get_labels(
CFG_SELECTOR);
122 const auto source_operation = source_operations.back();
123 for(
const auto target_operation : target_operations)
126 "---Adding Control Dependence " +
GET_NAME(fcfg, source_operation) +
"-->" +
129 for(
const auto label : labels)
138 for(boost::tie(basic_block, basic_block_end) = boost::vertices(*bb_cdg); basic_block != basic_block_end;
141 const auto bb_node_info = bb_cdg->CGetBBNodeInfo(*basic_block);
142 const auto cer_index = bb_node_info->cer;
143 for(
const auto statement : bb_node_info->statements_list)
145 fcfg->GetOpNodeInfo(statement)->cer = cer_index;
149 if(
parameters->getOption<
bool>(OPT_print_dot))
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
#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;.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
DesignFlowStep_Status InternalExec() override
Performs the computation of the CDG representation.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
unsigned int bb_version
The version of the basic block intermediate representation on which this step has been applied...
Auxiliary methods for manipulating string.
boost::graph_traits< graph >::edge_iterator EdgeIterator
edge_iterator definition.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Control dependence graph.
#define CDG_SELECTOR
Control dependence edge selector.
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.
~OpCdgComputation() override
Destructor.
Target must be reexecuted.
boost::graph_traits< graph >::vertex_iterator VertexIterator
vertex_iterator definition.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
Basic block control dependence graph.
Class specification of the basic_block structure.
This file collects some hash functors.
Data structures used in operations graph.
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.
Analysis step computing operation control dependencies.
This class provides methods to build an operations graph.
OpCdgComputation(const ParameterConstRef Param, const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
#define CFG_SELECTOR
Control flow graph edge selector.
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.