From deae6a8bbcfd6bd2f919a8e8aabeb28cd10d101b Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 17 Nov 2011 23:45:00 +0000 Subject: [PATCH] Use the canonical decl to index so that we can really find it later. Fixes rdar://10433202 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144938 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 7a99d897c1..efffd2ca4c 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -851,7 +851,7 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method, Virtuality, VIndex, ContainingType, Flags, CGM.getLangOptions().Optimize); - SPCache[Method] = llvm::WeakVH(SP); + SPCache[Method->getCanonicalDecl()] = llvm::WeakVH(SP); return SP; } @@ -1690,7 +1690,7 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) { getContextDescriptor(cast(D->getDeclContext())); llvm::DenseMap::iterator - MI = SPCache.find(FD); + MI = SPCache.find(FD->getCanonicalDecl()); if (MI != SPCache.end()) { llvm::DISubprogram SP(dyn_cast_or_null(&*MI->second)); if (SP.isSubprogram() && !llvm::DISubprogram(SP).isDefinition()) @@ -1701,7 +1701,7 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) { E = FD->redecls_end(); I != E; ++I) { const FunctionDecl *NextFD = *I; llvm::DenseMap::iterator - MI = SPCache.find(NextFD); + MI = SPCache.find(NextFD->getCanonicalDecl()); if (MI != SPCache.end()) { llvm::DISubprogram SP(dyn_cast_or_null(&*MI->second)); if (SP.isSubprogram() && !llvm::DISubprogram(SP).isDefinition()) @@ -1759,7 +1759,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, if (const FunctionDecl *FD = dyn_cast(D)) { // If there is a DISubprogram for this function available then use it. llvm::DenseMap::iterator - FI = SPCache.find(FD); + FI = SPCache.find(FD->getCanonicalDecl()); if (FI != SPCache.end()) { llvm::DIDescriptor SP(dyn_cast_or_null(&*FI->second)); if (SP.isSubprogram() && llvm::DISubprogram(SP).isDefinition()) { -- 2.50.1