summaryrefslogtreecommitdiff
path: root/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/CallGraph.cpp')
-rw-r--r--lib/Analysis/CallGraph.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp
index f41a96d30ea5..91a8492eaa54 100644
--- a/lib/Analysis/CallGraph.cpp
+++ b/lib/Analysis/CallGraph.cpp
@@ -110,14 +110,13 @@ CallGraph::~CallGraph() {
bool CallGraph::includeInGraph(const Decl *D) {
assert(D);
- if (!D->getBody())
+ if (!D->hasBody())
return false;
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
// We skip function template definitions, as their semantics is
// only determined when they are instantiated.
- if (!FD->isThisDeclarationADefinition() ||
- FD->isDependentContext())
+ if (FD->isDependentContext())
return false;
IdentifierInfo *II = FD->getIdentifier();
@@ -125,11 +124,6 @@ bool CallGraph::includeInGraph(const Decl *D) {
return false;
}
- if (const ObjCMethodDecl *ID = dyn_cast<ObjCMethodDecl>(D)) {
- if (!ID->isThisDeclarationADefinition())
- return false;
- }
-
return true;
}
@@ -152,6 +146,9 @@ CallGraphNode *CallGraph::getNode(const Decl *F) const {
}
CallGraphNode *CallGraph::getOrInsertNode(Decl *F) {
+ if (F && !isa<ObjCMethodDecl>(F))
+ F = F->getCanonicalDecl();
+
CallGraphNode *&Node = FunctionMap[F];
if (Node)
return Node;