aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-07-24 03:41:11 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-07-24 03:41:11 +0000
commite3e643f12cc65a70e440bcdbb37b81d5fd022143 (patch)
tree54694e42b4b5e10c11061b515f85bc18c3c69798 /lib
parent6d8f56f4799042c897831318326d8be55a879cb8 (diff)
Add getDecl() to CallGraph and CallGraphNode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/CallGraph.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp
index 07c2b35349..1e28411eb4 100644
--- a/lib/Analysis/CallGraph.cpp
+++ b/lib/Analysis/CallGraph.cpp
@@ -108,6 +108,13 @@ CallGraphNode *CallGraph::getOrInsertFunction(Entity F) {
return Node = new CallGraphNode(F);
}
+Decl *CallGraph::getDecl(CallGraphNode *Node) {
+ // Get the function's context.
+ ASTContext *Ctx = CallerCtx[Node];
+
+ return Node->getDecl(*Ctx);
+}
+
void CallGraph::print(llvm::raw_ostream &os) {
for (iterator I = begin(), E = end(); I != E; ++I) {
if (I->second->hasCallee()) {