50 #include <boost/tuple/tuple.hpp> 56 : bg(_bg), bb_graph(new
BBGraph(bg, -1)), bb_index_map(bb_graph->GetBBGraphInfo()->bb_index_map)
64 size_t index = boost::num_vertices(*
bg);
69 bb_graph->GetBBGraphInfo()->entry_vertex = v;
74 bb_graph->GetBBGraphInfo()->exit_vertex = v;
76 bb_graph->GetBBNodeInfo(v)->block = info;
83 return bg->AddEdge(source, target, selector);
94 bg->RemoveSelector(source, target, selector);
99 bg->RemoveSelector(edge, selector);
103 const unsigned label)
107 boost::tie(e, inserted) = boost::edge(source, target, *
bg);
109 STR(
bb_graph->CGetBBNodeInfo(target)->block->number) +
" doesn't exists");
132 "this vertex does not exist " + std::to_string(block_index));
bool check_vertex(unsigned int block_index) const
return true in case the vertex has been already created
Definition of the node_info object for the basic_block graph.
#define BB_EXIT
constant identifying the basic block node of type exit
void add_operation_to_bb(vertex op, unsigned int index)
Add an operation to its basic block.
exceptions managed by PandA
EdgeDescriptor AddEdge(const vertex source, const vertex target, const int selector)
Add an edge selector.
This class provides methods to build a basic blocks graph.
#define FB_CDG_SELECTOR
Feedback control dependence edge selector.
Data structure describing a basic block at tree level.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
BasicBlocksGraphConstructor(BBGraphsCollectionRef _bg)
Constructor.
#define FB_CFG_SELECTOR
Feedback control flow edge selector.
CustomUnorderedMap< unsigned int, vertex > & bb_index_map
Map between basic block node index and vertices.
~BasicBlocksGraphConstructor()
Destructor.
const BBGraphRef bb_graph
Reference to graph with all the edges.
vertex Cget_vertex(unsigned int block_index) const
return a vertex of the graph given the functionID.
Class used to describe a particular graph with basic blocks as nodes.
#define CDG_SELECTOR
Control dependence edge selector.
void Clear()
Remove all vertices and edges.
void RemoveEdge(const vertex source, const vertex target, const int selector)
Remove an edge selector.
#define BB_ENTRY
constant identifying the basic block node of type entry
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
void add_bb_edge_info(const vertex source, const vertex target, int type, const unsigned int label)
add label to edge between vertex source and vertex target
vertex add_vertex(const blocRef info)
Add a new vertex to the basic blocks graphs.
EdgeDescriptor connect_to_entry(const vertex target)
add edge between entry and target
refcount< NodeInfo > NodeInfoRef
RefCount type definition of the NodeInfo class structure.
Data structures used to represent an edge in operation and basic block graphs.
const BBGraphsCollectionRef bg
reference to the bulk basic blocks graph
Class specification of the basic_block structure.
EdgeDescriptor connect_to_exit(const vertex source)
add edge between source and exit
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
#define CFG_SELECTOR
Control flow graph edge selector.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...