Builds call graph of a program that represents calling relationships between subroutines This class overrides several ASTVisitor's methods to populate the call graph's vertices and edges. Each vertex is a subroutine of the given program, and each edge represents which subroutine calls which subroutines.
More...
#include <CallGraphBuilder.h>
|
bool | visit (ASTFunction *element) override |
|
bool | visit (ASTFunAppExpr *element) override |
|
std::map< ASTFunction *, std::set< ASTFunction * > > | getCallGraph () |
| Returns the call graph, call graph a map from caller to callee, the callee is a set of ASTFunction* and the caller is an ASTFunction*. More...
|
|
std::map< ASTFunAppExpr *, std::set< ASTFunction * > > | getMayCall () |
| Returns the may call relation, which relates each call expression to the set of possible called functions. More...
|
|
std::map< std::string, ASTFunction * > | getFunMap () |
| Returns the map from a function name to its ASTFunction*, ASTFunction* is then used to fetch further information from the graph such as to fetch the subroutines called by a function, or that call the function. More...
|
|
Builds call graph of a program that represents calling relationships between subroutines This class overrides several ASTVisitor's methods to populate the call graph's vertices and edges. Each vertex is a subroutine of the given program, and each edge represents which subroutine calls which subroutines.
◆ build()
Returns the CallGraphBuilder for a given program.
- Parameters
-
ast | The AST of the program |
cfa | The control flow analyzer |
- Returns
- the CallGraphBuilder for the given program
◆ getCallGraph()
Returns the call graph, call graph a map from caller to callee, the callee is a set of ASTFunction* and the caller is an ASTFunction*.
◆ getFunMap()
std::map< std::string, ASTFunction * > CallGraphBuilder::getFunMap |
( |
| ) |
|
Returns the map from a function name to its ASTFunction*, ASTFunction* is then used to fetch further information from the graph such as to fetch the subroutines called by a function, or that call the function.
- Returns
- std::map<std::string, ASTFunction*> fromFunNameToASTFun
◆ getMayCall()
Returns the may call relation, which relates each call expression to the set of possible called functions.
◆ visit() [1/2]
◆ visit() [2/2]
The documentation for this class was generated from the following files: