class CallGraph
Declaration
class CallGraph : public RecursiveASTVisitor { /* full declaration omitted */ };
Description
The AST-based call graph. The call graph extends itself with the given declarations by implementing the recursive AST visitor, which constructs the graph by visiting the given declarations.
Declared at: clang/include/clang/Analysis/CallGraph.h:42
Inherits from: RecursiveASTVisitor
Member Variables
- private clang::CallGraph::FunctionMapTy FunctionMap
- FunctionMap owns all CallGraphNodes.
- private clang::CallGraphNode* Root
- This is a virtual root node that has edges to all the functions.
Method Overview
- public CallGraph()
- public bool TraverseStmt(clang::Stmt * S)
- public bool VisitFunctionDecl(clang::FunctionDecl * FD)
- public bool VisitObjCMethodDecl(clang::ObjCMethodDecl * MD)
- private void addNodeForDecl(clang::Decl * D, bool IsGlobal)
- public void addNodesForBlocks(clang::DeclContext * D)
- public void addToCallGraph(clang::Decl * D)
- public clang::CallGraph::iterator begin()
- public clang::CallGraph::const_iterator begin() const
- public void dump() const
- public clang::CallGraph::iterator end()
- public clang::CallGraph::const_iterator end() const
- public clang::CallGraphNode * getNode(const clang::Decl *) const
- public clang::CallGraphNode * getOrInsertNode(clang::Decl *)
- public clang::CallGraphNode * getRoot() const
- public static bool includeCalleeInGraph(const clang::Decl * D)
- public static bool includeInGraph(const clang::Decl * D)
- public void print(llvm::raw_ostream & os) const
- public bool shouldVisitImplicitCode() const
- public bool shouldVisitTemplateInstantiations() const
- public bool shouldWalkTypesOfTypeLocs() const
- public unsigned int size() const
- public void viewGraph() const
- public ~CallGraph()
Methods
¶CallGraph()
CallGraph()
Declared at: clang/include/clang/Analysis/CallGraph.h:55
¶bool TraverseStmt(clang::Stmt* S)
bool TraverseStmt(clang::Stmt* S)
Declared at: clang/include/clang/Analysis/CallGraph.h:136
Parameters
- clang::Stmt* S
¶bool VisitFunctionDecl(clang::FunctionDecl* FD)
bool VisitFunctionDecl(clang::FunctionDecl* FD)
Description
Part of recursive declaration visitation. We recursively visit all the declarations to collect the root functions.
Declared at: clang/include/clang/Analysis/CallGraph.h:112
Parameters
¶bool VisitObjCMethodDecl(
clang::ObjCMethodDecl* MD)
bool VisitObjCMethodDecl(
clang::ObjCMethodDecl* MD)
Description
Part of recursive declaration visitation.
Declared at: clang/include/clang/Analysis/CallGraph.h:127
Parameters
¶void addNodeForDecl(clang::Decl* D, bool IsGlobal)
void addNodeForDecl(clang::Decl* D, bool IsGlobal)
Description
Add the given declaration to the call graph.
Declared at: clang/include/clang/Analysis/CallGraph.h:144
Parameters
- clang::Decl* D
- bool IsGlobal
¶void addNodesForBlocks(clang::DeclContext* D)
void addNodesForBlocks(clang::DeclContext* D)
Declared at: clang/include/clang/Analysis/CallGraph.h:108
Parameters
¶void addToCallGraph(clang::Decl* D)
void addToCallGraph(clang::Decl* D)
Description
Populate the call graph with the functions in the given declaration. Recursively walks the declaration to find all the dependent Decls as well.
Declared at: clang/include/clang/Analysis/CallGraph.h:62
Parameters
- clang::Decl* D
¶clang::CallGraph::iterator begin()
clang::CallGraph::iterator begin()
Description
Iterators through all the elements in the graph. Note, this gives non-deterministic order.
Declared at: clang/include/clang/Analysis/CallGraph.h:86
¶clang::CallGraph::const_iterator begin() const
clang::CallGraph::const_iterator begin() const
Declared at: clang/include/clang/Analysis/CallGraph.h:88
¶void dump() const
void dump() const
Declared at: clang/include/clang/Analysis/CallGraph.h:105
¶clang::CallGraph::iterator end()
clang::CallGraph::iterator end()
Declared at: clang/include/clang/Analysis/CallGraph.h:87
¶clang::CallGraph::const_iterator end() const
clang::CallGraph::const_iterator end() const
Declared at: clang/include/clang/Analysis/CallGraph.h:89
¶clang::CallGraphNode* getNode(
const clang::Decl*) const
clang::CallGraphNode* getNode(
const clang::Decl*) const
Description
Lookup the node for the given declaration.
Declared at: clang/include/clang/Analysis/CallGraph.h:75
Parameters
- const clang::Decl*
¶clang::CallGraphNode* getOrInsertNode(
clang::Decl*)
clang::CallGraphNode* getOrInsertNode(
clang::Decl*)
Description
Lookup the node for the given declaration. If none found, insert one into the graph.
Declared at: clang/include/clang/Analysis/CallGraph.h:79
Parameters
¶clang::CallGraphNode* getRoot() const
clang::CallGraphNode* getRoot() const
Description
Get the virtual root of the graph, all the functions available externally are represented as callees of the node.
Declared at: clang/include/clang/Analysis/CallGraph.h:96
¶static bool includeCalleeInGraph(
const clang::Decl* D)
static bool includeCalleeInGraph(
const clang::Decl* D)
Description
Determine if a declaration should be included in the graph for the purposes of being a callee. This is similar to includeInGraph except it permits declarations, not just definitions.
Declared at: clang/include/clang/Analysis/CallGraph.h:72
Parameters
- const clang::Decl* D
¶static bool includeInGraph(const clang::Decl* D)
static bool includeInGraph(const clang::Decl* D)
Description
Determine if a declaration should be included in the graph.
Declared at: clang/include/clang/Analysis/CallGraph.h:67
Parameters
- const clang::Decl* D
¶void print(llvm::raw_ostream& os) const
void print(llvm::raw_ostream& os) const
Declared at: clang/include/clang/Analysis/CallGraph.h:104
Parameters
¶bool shouldVisitImplicitCode() const
bool shouldVisitImplicitCode() const
Declared at: clang/include/clang/Analysis/CallGraph.h:140
¶bool shouldVisitTemplateInstantiations() const
bool shouldVisitTemplateInstantiations() const
Declared at: clang/include/clang/Analysis/CallGraph.h:139
¶bool shouldWalkTypesOfTypeLocs() const
bool shouldWalkTypesOfTypeLocs() const
Declared at: clang/include/clang/Analysis/CallGraph.h:138
¶unsigned int size() const
unsigned int size() const
Description
Get the number of nodes in the graph.
Declared at: clang/include/clang/Analysis/CallGraph.h:92
¶void viewGraph() const
void viewGraph() const
Declared at: clang/include/clang/Analysis/CallGraph.h:106
¶~CallGraph()
~CallGraph()
Declared at: clang/include/clang/Analysis/CallGraph.h:56