From 1ac9c98e6c40d9a1e6cb904b414161388af4a89c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 11 Apr 2017 21:13:37 +0000 Subject: Modular Codegen: Support homing debug info for types in modular objects Matching the function-homing support for modular codegen. Any type implicitly (implicit template specializations) or explicitly defined in a module is attached to that module's object file and omitted elsewhere (only a declaration used if necessary for references). llvm-svn: 299987 --- clang/lib/CodeGen/CodeGenModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 96358bf6119..7fe8bf04129 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3820,6 +3820,11 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { EmitDeclContext(cast(D)); break; case Decl::CXXRecord: + if (DebugInfo) { + if (auto *ES = D->getASTContext().getExternalSource()) + if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) + DebugInfo->completeUnusedClass(cast(*D)); + } // Emit any static data members, they may be definitions. for (auto *I : cast(D)->decls()) if (isa(I) || isa(I)) -- cgit v1.2.3