From abb9bf4bcf98a226d9350448e31411eb55e9efb0 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Fri, 7 Aug 2020 16:11:41 -0700 Subject: Revert "[Clang] implement -fno-eliminate-unused-debug-types" This reverts commit e486921fd6cf96ae9114adac455f7c0b5c1088a7. Breaks windows builds and osx builds. --- clang/lib/CodeGen/CodeGenModule.cpp | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 67f06ac1c07c..f3712ea1f541 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -5392,21 +5392,16 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { Spec->hasDefinition()) DI->completeTemplateDefinition(*Spec); } LLVM_FALLTHROUGH; - case Decl::CXXRecord: { - CXXRecordDecl *CRD = cast(D); - if (CGDebugInfo *DI = getModuleDebugInfo()) { - if (CRD->hasDefinition()) - DI->EmitAndRetainType(getContext().getRecordType(cast(D))); + case Decl::CXXRecord: + if (CGDebugInfo *DI = getModuleDebugInfo()) if (auto *ES = D->getASTContext().getExternalSource()) if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) - DI->completeUnusedClass(*CRD); - } + DI->completeUnusedClass(cast(*D)); // Emit any static data members, they may be definitions. - for (auto *I : CRD->decls()) + for (auto *I : cast(D)->decls()) if (isa(I) || isa(I)) EmitTopLevelDecl(I); break; - } // No code generation needed. case Decl::UsingShadow: case Decl::ClassTemplate: @@ -5592,25 +5587,6 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { EmitOMPRequiresDecl(cast(D)); break; - case Decl::Typedef: - case Decl::TypeAlias: // using foo = bar; [C++11] - if (CGDebugInfo *DI = getModuleDebugInfo()) - DI->EmitAndRetainType( - getContext().getTypedefType(cast(D))); - break; - - case Decl::Record: - if (CGDebugInfo *DI = getModuleDebugInfo()) - if (cast(D)->getDefinition()) - DI->EmitAndRetainType(getContext().getRecordType(cast(D))); - break; - - case Decl::Enum: - if (CGDebugInfo *DI = getModuleDebugInfo()) - if (cast(D)->getDefinition()) - DI->EmitAndRetainType(getContext().getEnumType(cast(D))); - break; - default: // Make sure we handled everything we should, every other kind is a // non-top-level decl. FIXME: Would be nice to have an isTopLevelDeclKind -- cgit v1.2.3