r189504 - Comments for r189494
David Blaikie
dblaikie at gmail.com
Wed Aug 28 13:24:55 PDT 2013
Author: dblaikie
Date: Wed Aug 28 15:24:55 2013
New Revision: 189504
URL: http://llvm.org/viewvc/llvm-project?rev=189504&view=rev
Log:
Comments for r189494
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=189504&r1=189503&r2=189504&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Aug 28 15:24:55 2013
@@ -1124,9 +1124,14 @@ CollectCXXMemberFunctions(const CXXRecor
E = RD->decls_end(); I != E; ++I) {
if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(*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<const FunctionDecl *, llvm::WeakVH>::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
More information about the cfe-commits
mailing list