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