summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-28 20:24:55 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-28 20:24:55 +0000
commit8c8e8e237606ea06b14ea887db5a1b637741d48b (patch)
treef0dcb493b4401f712800ff6c96776378bce80317
parent187a169603bb7d99a3007022d5d5e43dd4651b38 (diff)
downloadbcm5719-llvm-8c8e8e237606ea06b14ea887db5a1b637741d48b.tar.gz
bcm5719-llvm-8c8e8e237606ea06b14ea887db5a1b637741d48b.zip
Comments for r189494
llvm-svn: 189504
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 09202bbbb83..f9570abef74 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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<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
OpenPOWER on IntegriCloud