From: David Blaikie Date: Wed, 28 Aug 2013 20:24:55 +0000 (+0000) Subject: Comments for r189494 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a68491fa179572e6b2c1364e7ff24c05110324b;p=clang Comments for r189494 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189504 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 09202bbbb8..f9570abef7 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1124,9 +1124,14 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DIFile Unit, E = RD->decls_end(); I != E; ++I) { if (const CXXMethodDecl *Method = dyn_cast(*I)) { // Reuse the existing member function declaration if it exists + // It may be associated with the declaration of the type & should be + // reused as we're building the definition. llvm::DenseMap::iterator MI = SPCache.find(Method->getCanonicalDecl()); if (MI == SPCache.end()) { + // If the member is implicit, lazily create it when we see the + // definition, not before. (an ODR-used implicit default ctor that's + // never actually code generated should not produce debug info) if (!Method->isImplicit()) EltTys.push_back(CreateCXXMemberFunction(Method, Unit, RecordTy)); } else