summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-04-29 23:42:32 +0000
committerDevang Patel <dpatel@apple.com>2011-04-29 23:42:32 +0000
commita3e3fded0a538beb8faaf98610391b10b816738c (patch)
tree575b666fe2d38454ad8578a7d4361c462142bea7 /clang/lib/CodeGen/CGDebugInfo.cpp
parent4105ed1523021de435a1980f629787868b29d799 (diff)
downloadbcm5719-llvm-a3e3fded0a538beb8faaf98610391b10b816738c.tar.gz
bcm5719-llvm-a3e3fded0a538beb8faaf98610391b10b816738c.zip
Tie constructor defintion with its declaration using AT_specification.
llvm-svn: 130561
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 4b2b9085169..87b02acec7b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -772,10 +772,7 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method,
Virtuality, VIndex, ContainingType,
Flags, CGM.getLangOptions().Optimize);
- // Don't cache ctors or dtors since we have to emit multiple functions for
- // a single ctor or dtor.
- if (!IsCtorOrDtor)
- SPCache[Method] = llvm::WeakVH(SP);
+ SPCache[Method] = llvm::WeakVH(SP);
return SP;
}
@@ -1592,6 +1589,14 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) {
// Setup context.
getContextDescriptor(cast<Decl>(D->getDeclContext()));
+ llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
+ MI = SPCache.find(FD);
+ if (MI != SPCache.end()) {
+ llvm::DISubprogram SP(dyn_cast_or_null<llvm::MDNode>(&*MI->second));
+ if (SP.isSubprogram() && !llvm::DISubprogram(SP).isDefinition())
+ return SP;
+ }
+
for (FunctionDecl::redecl_iterator I = FD->redecls_begin(),
E = FD->redecls_end(); I != E; ++I) {
const FunctionDecl *NextFD = *I;
OpenPOWER on IntegriCloud