Skip to content

Add call-graph overview #2776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/analyses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ To be documented.

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

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

\subsection analyses-dominator Dominator analysis (cfg_dominators_templatet)

Expand Down
17 changes: 17 additions & 0 deletions src/analyses/call_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ Author: Daniel Kroening, [email protected]
#include <goto-programs/goto_model.h>
#include <util/graph.h>

/// 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
/// \ref 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 \ref grapht
/// and thus processed using the full graph algorithms library using the
/// \ref get_directed_graph method. See also \ref 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 \ref call_grapht::callsites
/// collection.
class call_grapht
{
public:
Expand Down