12 #ifndef CPROVER_ANALYSES_CALL_GRAPH_H 13 #define CPROVER_ANALYSES_CALL_GRAPH_H 62 void output(std::ostream &out)
const;
66 typedef std::unordered_set<irep_idt, irep_id_hash>
nodest;
70 typedef std::multimap<irep_idt, irep_idt>
edgest;
73 typedef std::pair<irep_idt, irep_idt>
edget;
151 #endif // CPROVER_ANALYSES_CALL_GRAPH_H call_grapht(bool collect_callsites=false)
Create empty call graph.
void add(const irep_idt &caller, const irep_idt &callee)
Add edge.
A generic directed graph with a parametric node type.
goto_programt::const_targett locationt
Type of a callsite stored in member callsites
Edge of the directed graph representation of this call graph.
locationst callsites
Callsites responsible for this graph edge.
std::map< edget, locationst > callsitest
Type mapping from call-graph edges onto the set of call instructions that make that call...
optionalt< node_indext > get_node_index(const irep_idt &function) const
Find the graph node by function name.
Node of the directed graph representation of this call graph.
std::unordered_map< irep_idt, node_indext > nodes_by_namet
Type of the node name -> node index map.
directed_grapht get_directed_graph() const
Returns a grapht representation of this call graph, suitable for use with generic grapht algorithms...
std::string format_callsites(const edget &edge) const
Prints callsites responsible for a graph edge as comma-separated location numbers, e.g.
void output_xml(std::ostream &out) const
nonstd::optional< T > optionalt
void output_dot(std::ostream &out) const
instructionst::const_iterator const_targett
std::unordered_map< irep_idt, node_indext > nodes_by_name
Maps function names onto node indices.
callsitest callsites
Map from call-graph edges to a set of callsites that make the given call.
static call_grapht create_from_root_function(const goto_modelt &model, const irep_idt &root, bool collect_callsites)
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
void output(std::ostream &out) const
std::unordered_set< irep_idt, irep_id_hash > nodest
Type of the nodes in the call graph.
A generic container class for the GOTO intermediate representation of one function.
std::set< locationt > locationst
Type of a set of callsites.
A Template Class for Graphs.
static call_grapht create_from_root_function(const goto_functionst &functions, const irep_idt &root, bool collect_callsites)
edgest edges
Call graph, including duplicate key-value pairs when there are parallel edges (see grapht documentati...
Directed graph representation of this call graph.
const nodes_by_namet & get_nodes_by_name() const
Get the node name -> node index map.
std::multimap< irep_idt, irep_idt > edgest
Type of the edges in the call graph.
std::pair< irep_idt, irep_idt > edget
Type of a call graph edge in edgest
call_grapht get_inverted() const
Returns an inverted copy of this call graph.
This class represents a node in a directed graph.