55 #include <boost/graph/adjacency_list.hpp> 56 #include <boost/graph/detail/adjacency_list.hpp> 57 #include <boost/graph/detail/edge.hpp> 58 #include <boost/graph/filtered_graph.hpp> 59 #include <boost/iterator/iterator_facade.hpp> 103 return block->live_in;
108 return block->live_out;
149 :
graph(_g.get(), _selector, sub)
156 WriteDot(file_name, annotated, detail_level);
162 const auto function_name = bb_graph_info->AppM->CGetFunctionBehavior(bb_graph_info->function_index)
163 ->CGetBehavioralHelper()
164 ->get_function_name();
165 std::string output_directory =
167 if(not std::filesystem::exists(output_directory))
169 std::filesystem::create_directories(output_directory);
171 const std::string
full_name = output_directory + file_name;
172 const VertexWriterConstRef bb_writer(
new BBWriter(
this, annotated));
173 const EdgeWriterConstRef bb_edge_writer(
new BBEdgeWriter(
this));
174 InternalWriteDot<const BBWriter, const BBEdgeWriter>(
full_name, bb_writer, bb_edge_writer);
179 return boost::num_vertices(m_g) - 2;
208 return !cdg_edge_T() and !cdg_edge_F() and !cfg_edge_T() and !cfg_edge_F() and
214 if(labels.find(selector) != labels.end())
216 return labels.find(selector)->second;
242 if(source_x == source_y)
BBVertexSorter bb_sorter
The vertex sorter.
const CustomOrderedSet< unsigned int > & get_live_in() const
Returns the live in of the basic block.
const ParameterConstRef parameters
Set of input parameters.
Base class storing user data information to the whole graph.
bool operator()(const vertex x, const vertex y) const
Compare position of two vertices.
Definition of the class representing a generic C application.
const CustomOrderedSet< unsigned int > get_labels(const int selector) const
Return the labels associated with a selector.
void WriteDot(const std::string &file_name, const int detail_level=0) const
Writes this graph in dot format.
const BBGraphInfoConstRef CGetBBGraphInfo() const
Returns the property associated with the graph.
Class specification of the graph structures.
bool cdg_edge_F() const
Function returning true when the edge is an else control dependence edge, false otherwise.
Definition of hash function for EdgeDescriptor.
BBGraphsCollection(const BBGraphInfoRef bb_graph_info, const ParameterConstRef parameters)
Constructor.
Data structure describing a basic block at tree level.
BBEdgeSorter(const BBGraphConstRef bb_graph)
Constructor.
std::list< vertex > statements_list
List of operation vertices associated with basic block node.
bool cfg_edge_T() const
Function returning true when the edge is a then control flow edge, false otherwise.
bool cdg_edge_T() const
Function returning true when the edge is a then control dependence edge, false otherwise.
unsigned long long epp_value
edge instrumented weight
unsigned int cer
id of the control equivalent region
size_t size() const
Returns the number of vertices of the graph representing the original program, associated with the cu...
#define CDG_SELECTOR
Control dependence edge selector.
BBNodeInfo()
Empty constructor.
const int selector
selector
const CustomOrderedSet< unsigned int > & get_live_out() const
Returns the live in of the basic block.
bool empty() const
Returns true if there is no node associated with the basic block.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
#define T_COND
constant used to represent control edges representing a true edge of a conditional statement...
BBGraphConstRef bb_graph
The basic block graph to which edges belong Note: this should be const, but can not because of assign...
General class used to describe a graph in PandA.
~BBGraphsCollection() override
Destructor.
This struct specifies the block node.
bool cfg_edge_F() const
Function returning true when the edge is an else control flow edge, false otherwise.
unsigned int loop_id
id of the loop to which basic block belongs to (0 if it doesn't belong to any loop) ...
BBVertexSorter(const BBGraphConstRef bb_graph)
Constructor.
void add_operation_node(const vertex op)
Adds an operation to the list of the statements.
Collect all structs used to write a graph in the dot format.
Class specification of the basic_block structure.
BBGraph(const BBGraphsCollectionRef _g, int selector)
Standard constructor.
const BBNodeInfoConstRef CGetBBNodeInfo(const vertex node) const
Return the info associated with a basic block.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
bool switch_p() const
Function returning true when the edge is a control flow edge exiting from a switch, false otherwise.
void set_epp_value(unsigned long long _epp_value)
Function that sets the epp_edge associated with the edge.
BBGraphInfo(const application_managerConstRef AppM, const unsigned int function_index)
Constructor with profiling information.
this class is used to manage the command-line or XML options.
~BBEdgeInfo() override
Destructor.
#define F_COND
constant used to represent control edges representing a false edge of a conditional statement...
unsigned int get_bb_index() const
Returns the index of the basic block.
size_t num_bblocks() const
Returns the number of basic blocks contained into the graph.
bool operator()(const EdgeDescriptor x, const EdgeDescriptor y) const
Compare position of two edges.
x
Return the smallest n such that 2^n >= _x.
BBGraphConstRef bb_graph
The basic block graph to which vertices belong Note: this should be const, but can not because of ass...
graphs_collection * collection
The graph collection.
Class which prints the edge of a basic block graph in dot format.
#define CFG_SELECTOR
Control flow graph edge selector.
vertex get_last_operation() const
Returns the last operation vertex associated with the basic block.
unsigned long long get_epp_value() const
Function returning the epp_value associated with the edge.
vertex get_first_operation() const
Returns the first operation vertex associated with the basic block.
#define NULL_VERTEX
null vertex definition
A brief description of the C++ Header File.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.