49 #include "config_HAVE_HOST_PROFILING_BUILT.hpp" 73 :
graph(call_graphs_collection.get(), _selector)
79 :
graph(call_graphs_collection.get(), _selector, _vertices)
88 if(!std::filesystem::exists(output_directory))
90 std::filesystem::create_directories(output_directory);
92 const std::string
full_name = output_directory + file_name;
93 const VertexWriterConstRef function_writer(
new FunctionWriter(
this));
95 InternalWriteDot<const FunctionWriter, const FunctionEdgeWriter>(
full_name, function_writer, function_edge_writer);
106 "Function " + std::to_string(Cget_node_info<FunctionInfo, graph>(v, *
printing_graph)->nodeID) +
110 out <<
"[shape=box, label=\"" << FB->CGetBehavioralHelper()->get_function_name();
112 if(mem_nodeID.size())
115 for(
unsigned int l : mem_nodeID)
117 std::string label = FB->CGetBehavioralHelper()->PrintVariable(l);
136 Cget_edge_info<FunctionEdgeInfo, graph>(e, *
printing_graph)->direct_call_points;
138 Cget_edge_info<FunctionEdgeInfo, graph>(e, *
printing_graph)->indirect_call_points;
140 Cget_edge_info<FunctionEdgeInfo, graph>(e, *
printing_graph)->function_addresses;
152 THROW_ERROR(std::string(
"InconsistentDataStructure"));
155 out <<
"[color=" << color <<
", label=\"";
156 if(direct_call_points.size())
159 for(
const auto& call : direct_call_points)
161 out <<
"\\n" << call;
164 if(indirect_call_points.size())
166 if(direct_call_points.size())
171 for(
const auto& call : indirect_call_points)
173 out <<
"\\n" << call;
176 if(function_addresses.size())
178 if(direct_call_points.size() or indirect_call_points.size())
182 out <<
"TAKE ADDRESS: ";
183 for(
const auto& call : function_addresses)
185 out <<
"\\n" << call;
void operator()(std::ostream &out, const vertex &v) const override
operator function returning the label of the vertex
int GetSelector() const
Return the selector of this graph.
const ParameterConstRef parameters
Set of input parameters.
const graph * printing_graph
The graph to be printed.
Class specification of the graph structures.
Functor used by write_graphviz to write the label of the vertices of a function graph.
exceptions managed by PandA
void add_escape(std::string &ioString, const std::string &to_be_escaped)
Header include.
~FunctionEdgeWriter() override
Destructor.
Functor used by write_graphviz to write the edges of a function graph.
Auxiliary methods for manipulating string.
#define FEEDBACK_SELECTOR
const graph * printing_graph
The graph to be printed.
This class is the view of a call graph.
FunctionInfo()
Constructor.
Functor used to write the content of a vertex to dotty file.
void operator()(std::ostream &out, const EdgeDescriptor &e) const override
operator function returning the edge description
CallGraphsCollection(const CallGraphInfoRef call_graph_info, const ParameterConstRef _parameters)
Constructor.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
General class used to describe a graph in PandA.
FunctionEdgeWriter(const CallGraph *call_graph)
constructor
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
FunctionWriter(const CallGraph *call_graph)
constructor
~CallGraph() override
Destructor.
Functor used to write the content of the edges to a dotty file.
const std::map< unsigned int, FunctionBehaviorRef > & behaviors
reference to the behaviors
void WriteDot(const std::string &file_name) const
Write the call graph in dot format.
~CallGraphsCollection() override
Destructor.
CallGraph(const CallGraphsCollectionRef call_graphs_collection, const int selector)
Constructor.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
interface of loops finding algorithm
this class is used to manage the command-line or XML options.
graphs_collection * collection
The graph collection.
FunctionEdgeInfo()
Constructor.
const CallGraphInfoConstRef CGetCallGraphInfo() const
Return the info associated with the call graph.
A brief description of the C++ Header File.
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 ...