PandA-2024.02
Public Member Functions | Private Attributes
operations_graph_constructor Class Reference

class providing methods to manage an operations graph. More...

#include <operations_graph_constructor.hpp>

Collaboration diagram for operations_graph_constructor:
Collaboration graph
[legend]

Public Member Functions

vertex getIndex (const std::string &source)
 Return the vertex index given the id of the vertex node. More...
 
vertex CgetIndex (const std::string &source) const
 Return the vertex index given the id of the vertex node. More...
 
EdgeDescriptor AddEdge (const vertex source, const vertex dest, int selector)
 add an edge between vertex source and vertex dest More...
 
void RemoveEdge (const vertex source, const vertex dest, int selector)
 remove a selector between two vertices More...
 
void RemoveSelector (const EdgeDescriptor edge, const int selector)
 set the selector of an edge between vertex source and vertex dest More...
 
void CompressEdges ()
 Remove all redundant edges. More...
 
void Clear ()
 Remove all vertices and edges. More...
 
void add_edge_info (const vertex src, const vertex tgt, const int selector, unsigned int NodeID)
 Add edge info to the graph. More...
 
void AddOperation (const tree_managerRef TM, const std::string &src, const std::string &oper, unsigned int bb_index, const unsigned int node_id)
 Add the operation associated with a vertex. More...
 
void add_type (const std::string &src, unsigned int type)
 Add the type associated with a vertex. More...
 
 operations_graph_constructor (OpGraphsCollectionRef _og)
 Constructor. More...
 
 ~operations_graph_constructor ()
 Destructor. More...
 
void AddVariable (const vertex op_vertex, const unsigned int variable, const FunctionBehavior_VariableType variable_type, const FunctionBehavior_VariableAccessType access_type)
 Adds an access to a variable to an operation vertex. More...
 
void AddSourceCodeVariable (const vertex &Ver, unsigned int Vargc)
 Adds a (ssa-)variable to the set of variables referred by the operation vertex. More...
 
void add_parameter (const vertex &Ver, unsigned int Vargc)
 Adds a parameter to the vertex. More...
 
void add_called_function (const std::string &source, unsigned int called_function)
 Adds a call to the vertex. More...
 

Private Attributes

const OpGraphsCollectionRef og
 reference to the bulk operations graph More...
 
const OpGraphRef op_graph
 The graph with all the edges. More...
 
std::map< std::string, vertexindex_map
 Mapping between id to index. More...
 

Detailed Description

class providing methods to manage an operations graph.

Definition at line 70 of file operations_graph_constructor.hpp.

Constructor & Destructor Documentation

◆ operations_graph_constructor()

operations_graph_constructor::operations_graph_constructor ( OpGraphsCollectionRef  _og)
explicit

Constructor.

Header include.

Parameters
ogis the collection of operations graph

Definition at line 60 of file operations_graph_constructor.cpp.

References ~operations_graph_constructor().

Here is the call graph for this function:

◆ ~operations_graph_constructor()

operations_graph_constructor::~operations_graph_constructor ( )
default

Destructor.

Referenced by operations_graph_constructor().

Here is the caller graph for this function:

Member Function Documentation

◆ add_called_function()

void operations_graph_constructor::add_called_function ( const std::string &  source,
unsigned int  called_function 
)

Adds a call to the vertex.

Parameters
sourceis the vertex name at which the type is associated.
calledis the called function

Definition at line 181 of file operations_graph_constructor.cpp.

References getIndex(), and op_graph.

Here is the call graph for this function:

◆ add_edge_info()

void operations_graph_constructor::add_edge_info ( const vertex  src,
const vertex  tgt,
const int  selector,
unsigned int  NodeID 
)

Add edge info to the graph.

Parameters
srcis an unique id representing the source node.
tgtis an unique id representing the target node.
efis the family of the edge. See cdfg_edge_info class for details.
NodeIDis the NodeID of the variable carrying the data through the edge.

Definition at line 112 of file operations_graph_constructor.cpp.

References GET_NAME, og, and THROW_ASSERT.

◆ add_parameter()

void operations_graph_constructor::add_parameter ( const vertex Ver,
unsigned int  Vargc 
)

Adds a parameter to the vertex.

Parameters
Veris the operation vertex
Varis the node id associated to the variable referred by the operation vertex

Definition at line 176 of file operations_graph_constructor.cpp.

References op_graph.

◆ add_type()

void operations_graph_constructor::add_type ( const std::string &  src,
unsigned int  type 
)

Add the type associated with a vertex.

Parameters
sourceis the vertex name at which the type is associated.
typeis an unsigned int representing the type associated with source.

Definition at line 154 of file operations_graph_constructor.cpp.

References GET_NODE_INFO, getIndex(), og, THROW_ASSERT, and TYPE_GENERIC.

Here is the call graph for this function:

◆ AddEdge()

EdgeDescriptor operations_graph_constructor::AddEdge ( const vertex  source,
const vertex  dest,
int  selector 
)

add an edge between vertex source and vertex dest

Parameters
sourceis the source vertex
destis the dest vertexes
selectoris the type of the edge

Definition at line 92 of file operations_graph_constructor.cpp.

References og.

◆ AddOperation()

void operations_graph_constructor::AddOperation ( const tree_managerRef  TM,
const std::string &  src,
const std::string &  oper,
unsigned int  bb_index,
const unsigned int  node_id 
)

Add the operation associated with a vertex.

Parameters
TMis the tree manager
sourceis the vertex name at which the operation is associated.
operis a string representing the operation associated with source.
bb_indexis the basic block index associated with the operation.
node_idis the index of the tree node

Definition at line 122 of file operations_graph_constructor.cpp.

References tree_manager::CGetTreeReindex(), ENTRY, ENTRY_ID, EXIT, EXIT_ID, GET_NODE_INFO, tree_manager::get_tree_node_const(), getIndex(), og, op_graph, STR, and THROW_ASSERT.

Here is the call graph for this function:

◆ AddSourceCodeVariable()

void operations_graph_constructor::AddSourceCodeVariable ( const vertex Ver,
unsigned int  Vargc 
)

Adds a (ssa-)variable to the set of variables referred by the operation vertex.

Parameters
Veris the operation vertex
Varis the node id associated to the variable referred by the operation vertex

Definition at line 186 of file operations_graph_constructor.cpp.

References op_graph.

◆ AddVariable()

void operations_graph_constructor::AddVariable ( const vertex  op_vertex,
const unsigned int  variable,
const FunctionBehavior_VariableType  variable_type,
const FunctionBehavior_VariableAccessType  access_type 
)

Adds an access to a variable to an operation vertex.

Parameters
op_vertexis the operation to be considered
variableis the index of the variable
typeis the type of the variable
access_typeis the type of the access

Definition at line 169 of file operations_graph_constructor.cpp.

References op_graph.

◆ CgetIndex()

vertex operations_graph_constructor::CgetIndex ( const std::string &  source) const

Return the vertex index given the id of the vertex node.

Parameters
sourceis the name of the vertex.
Returns
the index associated with the source.

Definition at line 86 of file operations_graph_constructor.cpp.

References index_map, and THROW_ASSERT.

◆ Clear()

void operations_graph_constructor::Clear ( )

Remove all vertices and edges.

Definition at line 67 of file operations_graph_constructor.cpp.

References index_map, and og.

◆ CompressEdges()

void operations_graph_constructor::CompressEdges ( )

Remove all redundant edges.

Definition at line 107 of file operations_graph_constructor.cpp.

References og.

◆ getIndex()

vertex operations_graph_constructor::getIndex ( const std::string &  source)

Return the vertex index given the id of the vertex node.

Parameters
sourceis the name of the vertex.
Returns
the index associated with the source.

Definition at line 73 of file operations_graph_constructor.cpp.

References index_map, and og.

Referenced by add_called_function(), add_type(), and AddOperation().

Here is the caller graph for this function:

◆ RemoveEdge()

void operations_graph_constructor::RemoveEdge ( const vertex  source,
const vertex  dest,
int  selector 
)

remove a selector between two vertices

Parameters
sourceis the source vertex
destis the dest vertexes
selectoris the type of the edge

Definition at line 97 of file operations_graph_constructor.cpp.

References og.

◆ RemoveSelector()

void operations_graph_constructor::RemoveSelector ( const EdgeDescriptor  edge,
const int  selector 
)

set the selector of an edge between vertex source and vertex dest

Parameters
edgeis the edge descriptor from which the selector has to be removed
selectoris the selector to be removed

Definition at line 102 of file operations_graph_constructor.cpp.

References og.

Field Documentation

◆ index_map

std::map<std::string, vertex> operations_graph_constructor::index_map
private

Mapping between id to index.

Definition at line 80 of file operations_graph_constructor.hpp.

Referenced by CgetIndex(), Clear(), and getIndex().

◆ og

const OpGraphsCollectionRef operations_graph_constructor::og
private

reference to the bulk operations graph

Definition at line 74 of file operations_graph_constructor.hpp.

Referenced by add_edge_info(), add_type(), AddEdge(), AddOperation(), Clear(), CompressEdges(), getIndex(), RemoveEdge(), and RemoveSelector().

◆ op_graph

const OpGraphRef operations_graph_constructor::op_graph
private

The graph with all the edges.

Definition at line 77 of file operations_graph_constructor.hpp.

Referenced by add_called_function(), add_parameter(), AddOperation(), AddSourceCodeVariable(), and AddVariable().


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

Generated on Mon Feb 12 2024 13:03:59 for PandA-2024.02 by doxygen 1.8.13