Skip to content

Commit 665e183

Browse files
committed
Add call-graph overview
1 parent dbd6988 commit 665e183

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/analyses/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ To be documented.
2424

2525
\subsection analyses-call-graph Call graph and associated helpers (call_grapht)
2626

27-
To be documented.
27+
A [https://en.wikipedia.org/wiki/Call_graph](call graph) for a GOTO model or
28+
GOTO functions collection. \ref call_grapht implements a basic call graph, but
29+
can also export the graph in \ref grapht format, which permits more advanced
30+
graph algorithms to be applied; see \ref call_graph_helpers.h for functions
31+
that work with the \ref grapht representation.
2832

2933
\subsection analyses-dominator Dominator analysis (cfg_dominators_templatet)
3034

src/analyses/call_graph.h

+17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ Author: Daniel Kroening, [email protected]
1818
#include <goto-programs/goto_model.h>
1919
#include <util/graph.h>
2020

21+
/// A call graph (https://en.wikipedia.org/wiki/Call_graph) for a GOTO model
22+
/// or GOTO functions collection.
23+
///
24+
/// The public constructors build a complete call graph, while
25+
/// \ref call_grapht::create_from_root_function can be used to create a partial
26+
/// call graph rooted at a particular function.
27+
///
28+
/// The graph is stored as a `std::multimap`, and this class only provides basic
29+
/// tools to construct and query graphs, but it can be exported to a \ref grapht
30+
/// and thus processed using the full graph algorithms library using the
31+
/// \ref get_directed_graph method. See also \ref call_graph_helpers.h for
32+
/// helper methods that work with such grapht-derived call graphs.
33+
///
34+
/// The graph may optionally collect (and export) the callsite associated with
35+
/// each edge; pass the `collect_callsites` parameter to a constructor if you
36+
/// want this functionality, and query the \ref call_grapht::callsites
37+
/// collection.
2138
class call_grapht
2239
{
2340
public:

0 commit comments

Comments
 (0)