Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. A call graph is a
directed graph that represents calling relationships between subroutines
in a computer program. Specifically, each node represents a procedure
and each edge indicates that procedure f calls procedure g. Thus, a
cycle in the graph indicates recursive procedure calls. Call graphs are
a basic program analysis result that can be used for human understanding
of programs, or as a basis for further analyses, such as an analysis
that tracks the flow of values between procedures. One simple
application of call graphs is finding procedures that are never called.
Call graphs can be dynamic or static. A dynamic call graph is a record
of an execution of the program, e.g., as output by a profiler. Thus, a
dynamic call graph can be exact, but only describes one run of the
program. A static call graph is a call graph intended to represent every
possible run of the program. The exact static call graph is undecidable,
so static call graph algorithms are generally overapproximations. That
is, every call relationship that occurs is represented in the graph, and
possibly also some call relationships that would never occur in actual
runs of the program.