A call graph (https://en.wikipedia.org/wiki/Call_graph) for a GOTO model or GOTO functions collection. More...
#include <call_graph.h>
edgest callsites grapht representation of this call graph, suitable for use with generic grapht algorithms. grapht documentation). root root A call graph (https://en.wikipedia.org/wiki/Call_graph) for a GOTO model or GOTO functions collection.
The public constructors build a complete call graph, while call_grapht::create_from_root_function can be used to create a partial call graph rooted at a particular function.
The graph is stored as a std::multimap, and this class only provides basic tools to construct and query graphs, but it can be exported to a grapht and thus processed using the full graph algorithms library using the get_directed_graph method. See also call_graph_helpers.h for helper methods that work with such grapht-derived call graphs.
The graph may optionally collect (and export) the callsite associated with each edge; pass the collect_callsites parameter to a constructor if you want this functionality, and query the call_grapht::callsites collection.
Definition at line 43 of file call_graph.h.
Type mapping from call-graph edges onto the set of call instructions that make that call.
Definition at line 105 of file call_graph.h.
Type of the edges in the call graph.
Note parallel edges (e.g. A having two callsites both targeting B) result in multiple graph edges.
Definition at line 92 of file call_graph.h.
Type of a call graph edge in edgest
Definition at line 95 of file call_graph.h.
Type of a set of callsites.
Definition at line 101 of file call_graph.h.
Type of a callsite stored in member callsites
Definition at line 98 of file call_graph.h.
Type of the nodes in the call graph.
Definition at line 88 of file call_graph.h.
Create empty call graph.
callsites map. Definition at line 21 of file call_graph.cpp.
Create complete call graph.
callsites map. Definition at line 30 of file call_graph.cpp.
Create complete call graph.
callsites map. Definition at line 39 of file call_graph.cpp.
Create call graph restricted to functions reachable from root
callsites map. Definition at line 115 of file call_graph.cpp.
Create call graph restricted to functions reachable from root
callsites map. Definition at line 75 of file call_graph.cpp.
Add edge.
Definition at line 139 of file call_graph.cpp.
Add edge with optional callsite information.
collect_callsites was specified during construction. Definition at line 153 of file call_graph.cpp.
Definition at line 123 of file call_graph.cpp.
Definition at line 61 of file call_graph.h.
Definition at line 53 of file call_graph.h.
Prints callsites responsible for a graph edge as comma-separated location numbers, e.g.
"{1, 2, 3}".
Definition at line 241 of file call_graph.cpp.
Returns a grapht representation of this call graph, suitable for use with generic grapht algorithms.
Note that parallel edges in call_grapht (e.g. A { B(); B(); } appearing as two A->B edges) will be condensed in the grapht output, so only one edge will appear. If collect_callsites was set when this call-graph was constructed the edge will be annotated with the call-site set.
Definition at line 209 of file call_graph.cpp.
Returns an inverted copy of this call graph.
Definition at line 165 of file call_graph.cpp.
Definition at line 272 of file call_graph.cpp.
Definition at line 255 of file call_graph.cpp.
Definition at line 282 of file call_graph.cpp.
Map from call-graph edges to a set of callsites that make the given call.
Definition at line 116 of file call_graph.h.
Definition at line 169 of file call_graph.h.
Call graph, including duplicate key-value pairs when there are parallel edges (see grapht documentation).
This representation is retained for backward compatibility; use get_directed_graph() to get a generic directed graph representation that provides more graph algorithms (shortest path, SCCs and so on).
Definition at line 112 of file call_graph.h.
Definition at line 113 of file call_graph.h.