PandA-2024.02
Public Member Functions
CallGraph Class Reference

This class is the view of a call graph. More...

#include <call_graph.hpp>

Inheritance diagram for CallGraph:
Inheritance graph
[legend]
Collaboration diagram for CallGraph:
Collaboration graph
[legend]

Public Member Functions

 CallGraph (const CallGraphsCollectionRef call_graphs_collection, const int selector)
 Constructor. More...
 
 CallGraph (const CallGraphsCollectionRef call_graphs_collection, const int selector, const CustomUnorderedSet< vertex > &vertices)
 Constructor. More...
 
 ~CallGraph () override
 Destructor. More...
 
const FunctionEdgeInfoConstRef CGetFunctionEdgeInfo (const EdgeDescriptor edge) const
 Return the info associated with an edge. More...
 
const CallGraphInfoConstRef CGetCallGraphInfo () const
 Return the info associated with the call graph. More...
 
CallGraphInfoRef GetCallGraphInfo ()
 Return the info associated with the call graph. More...
 
void WriteDot (const std::string &file_name) const
 Write the call graph in dot format. More...
 
- Public Member Functions inherited from graph
virtual ~graph ()=default
 Destructor. More...
 
bool is_in_subset (const boost::graph_traits< graph >::vertex_descriptor v) const
 return true in case the vertex is a vertex of the subgraph. More...
 
int GetSelector () const
 Return the selector of this graph. More...
 
int GetSelector (const edge_descriptor e) const
 Return the selectors associated with an edge. More...
 
int GetSelector (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Return the selectors associated with an edge. More...
 
void GetStronglyConnectedComponents (std::map< size_t, UnorderedSetStdStable< boost::graph_traits< graphs_collection >::vertex_descriptor >> &strongly_connected_components) const
 Compute the strongly connected components of the graph. More...
 
void BreadthFirstSearch (const boost::graph_traits< graphs_collection >::vertex_descriptor node, boost::bfs_visitor<> *vis) const
 Compute the breadth first search. More...
 
void ReverseTopologicalSort (std::deque< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const
 Compute the reverse topological order of the graph. More...
 
void TopologicalSort (std::list< boost::graph_traits< graphs_collection >::vertex_descriptor > &sorted_vertices) const
 Compute the topological order of the graph. More...
 
bool IsReachable (const boost::graph_traits< graphs_collection >::vertex_descriptor x, const boost::graph_traits< graphs_collection >::vertex_descriptor y) const
 Compute if vertex y is reachable from x. More...
 
NodeInfoRef GetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node)
 FIXME: this method should become protected and called by equivalent method in subclasses Get the node property. More...
 
GraphInfoRef GetGraphInfo ()
 FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More...
 
const GraphInfoConstRef CGetGraphInfo () const
 FIXME: this method should become protected and called by equivalent method in subclasses Get the graph property. More...
 
template<typename VertexWriterTemplate , typename EdgeWriterTemplate >
void InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer) const
 Print the graph in dot format FIXME: this method should become protected and called by WriteDot. More...
 
bool ExistsEdge (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Check if an edge exists. More...
 
boost::graph_traits< graphs_collection >::edge_descriptor CGetEdge (const boost::graph_traits< graphs_collection >::vertex_descriptor source, const boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Returns the edge connecting two vertices; throw error if it does not exist. More...
 
 graph (graphs_collection *g, const int _selector)
 Standard constructor. More...
 
 graph (graphs_collection *g, const int _selector, const CustomUnorderedSet< boost::graph_traits< graphs_collection >::vertex_descriptor > &vertices)
 Sub-graph constructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from graph
const NodeInfoConstRef CGetNodeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor node) const
 Get the node property. More...
 
EdgeInfoRef GetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target)
 Get the edge property. More...
 
const EdgeInfoConstRef CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target) const
 Get the edge property. More...
 
EdgeInfoRef GetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const
 Get the edge property. More...
 
EdgeInfoConstRef CGetEdgeInfo (typename boost::graph_traits< graphs_collection >::edge_descriptor edge) const
 Get the edge property. More...
 
template<typename VertexWriterTemplate , typename EdgeWriterTemplate , typename GraphWriterTemplate >
void InternalWriteDot (const std::string &file_name, const VertexWriterConstRef vertex_writer, const EdgeWriterConstRef edge_writer, const GraphWriterConstRef graph_writer) const
 Print the graph in dot format. More...
 
- Protected Attributes inherited from graph
graphs_collectioncollection
 The graph collection. More...
 
const int selector
 selector More...
 

Detailed Description

This class is the view of a call graph.

Definition at line 160 of file call_graph.hpp.

Constructor & Destructor Documentation

◆ CallGraph() [1/2]

CallGraph::CallGraph ( const CallGraphsCollectionRef  call_graphs_collection,
const int  selector 
)

Constructor.

Parameters
call_graphs_collectionis the starting call graphs collection
selectoris the selector of the view

Definition at line 72 of file call_graph.cpp.

◆ CallGraph() [2/2]

CallGraph::CallGraph ( const CallGraphsCollectionRef  call_graphs_collection,
const int  selector,
const CustomUnorderedSet< vertex > &  vertices 
)

Constructor.

Parameters
call_graphs_collectionis the starting call graphs collection
selectoris the selector of the view
verticesis the set of vertices to be considered

Definition at line 77 of file call_graph.cpp.

References ~CallGraph().

Here is the call graph for this function:

◆ ~CallGraph()

CallGraph::~CallGraph ( )
overridedefault

Destructor.

Referenced by CallGraph().

Here is the caller graph for this function:

Member Function Documentation

◆ CGetCallGraphInfo()

const CallGraphInfoConstRef CallGraph::CGetCallGraphInfo ( ) const
inline

Return the info associated with the call graph.

Returns
the info associated with the call graph

Definition at line 197 of file call_graph.hpp.

References graph::CGetGraphInfo().

Referenced by CalledFunctionsVisitor::back_edge(), and CalledFunctionsVisitor::finish_vertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CGetFunctionEdgeInfo()

const FunctionEdgeInfoConstRef CallGraph::CGetFunctionEdgeInfo ( const EdgeDescriptor  edge) const
inline

Return the info associated with an edge.

Parameters
edgeis the edge to be considered

Definition at line 188 of file call_graph.hpp.

References graph::CGetEdgeInfo().

Referenced by CallSitesCollectorVisitor::examine_edge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCallGraphInfo()

CallGraphInfoRef CallGraph::GetCallGraphInfo ( )
inline

Return the info associated with the call graph.

Returns
the info associated with the call graph

Definition at line 206 of file call_graph.hpp.

References graph::GetGraphInfo().

Here is the call graph for this function:

◆ WriteDot()

void CallGraph::WriteDot ( const std::string &  file_name) const

Write the call graph in dot format.

Parameters
file_nameis the name of the file to create

Definition at line 85 of file call_graph.cpp.

References graph::collection, test_panda::full_name, and graphs_collection::parameters.


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

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