[cfe-commits] r152350 - /cfe/trunk/lib/Analysis/CallGraph.cpp
Anna Zaks
ganna at apple.com
Thu Mar 8 15:16:26 PST 2012
Author: zaks
Date: Thu Mar 8 17:16:26 2012
New Revision: 152350
URL: http://llvm.org/viewvc/llvm-project?rev=152350&view=rev
Log:
Call Graph: Only the root node is allowed to have an invalid Decl*.
Modified:
cfe/trunk/lib/Analysis/CallGraph.cpp
Modified: cfe/trunk/lib/Analysis/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CallGraph.cpp?rev=152350&r1=152349&r2=152350&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CallGraph.cpp (original)
+++ cfe/trunk/lib/Analysis/CallGraph.cpp Thu Mar 8 17:16:26 2012
@@ -87,6 +87,7 @@
}
void CallGraph::addToCallGraph(Decl* D, bool IsGlobal) {
+ assert(D);
CallGraphNode *Node = getOrInsertFunction(D);
if (IsGlobal)
@@ -141,7 +142,9 @@
return Node;
Node = new CallGraphNode(F);
- ParentlessNodes.insert(Node);
+ // If not root, add to the parentless list.
+ if (F != 0)
+ ParentlessNodes.insert(Node);
return Node;
}
More information about the cfe-commits
mailing list