makeCallGraph: Display which routines call other routines via a graph

makeCallGraphR Documentation

Display which routines call other routines via a graph

Description

This function draws each routine in the specified file or translation unit as a node and adds directed edges from one node to another if the body of the former node calls the latter routine.

Usage

makeCallGraph(tu, withinFile = TRUE, .plot = TRUE, ...)

Arguments

tu

the name of a source file or a previously created translation unit object.

withinFile

a logical value that controls whether we only show calls to routines that are located in this translation unit or show nodes for routines that are not in this translation unit but are invoked in the code of any of the routines.

...

additional arguments that are passed to createTU. These can be include directories and pre-processor flags

.plot

a logical value that controls whether we draw the graph or just return the adjacency matrix.

Details

This uses the igraph package.

Value

If .plot is TRUE and the igraph package is available, the graph is displayed. In either case, the adjacency matrix is returned.

Author(s)

Duncan Temple Lang

References

libclang http://clang.llvm.org/doxygen/group__CINDEX.html

See Also

graph.adjacency in the igraph package.

Examples

g = makeCallGraph(system.file("exampleCode", "clangGen.c", package = "RCIndex"))

omegahat/RClangSimple documentation built on Jan. 17, 2024, 6:27 p.m.