diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2020-08-07 16:11:41 -0700 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2020-08-07 16:11:41 -0700 |
commit | abb9bf4bcf98a226d9350448e31411eb55e9efb0 (patch) | |
tree | 3f190ff504c10966ec65c5d68842767f9dd2c8ec /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 73413d266abc2436bd1993a4e21a9151bd102f17 (diff) | |
download | llvm-abb9bf4bcf98a226d9350448e31411eb55e9efb0.zip llvm-abb9bf4bcf98a226d9350448e31411eb55e9efb0.tar.gz llvm-abb9bf4bcf98a226d9350448e31411eb55e9efb0.tar.bz2 |
Revert "[Clang] implement -fno-eliminate-unused-debug-types"
This reverts commit e486921fd6cf96ae9114adac455f7c0b5c1088a7.
Breaks windows builds and osx builds.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 67f06ac..f3712ea 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<CXXRecordDecl>(D); - if (CGDebugInfo *DI = getModuleDebugInfo()) { - if (CRD->hasDefinition()) - DI->EmitAndRetainType(getContext().getRecordType(cast<RecordDecl>(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<CXXRecordDecl>(*D)); // Emit any static data members, they may be definitions. - for (auto *I : CRD->decls()) + for (auto *I : cast<CXXRecordDecl>(D)->decls()) if (isa<VarDecl>(I) || isa<CXXRecordDecl>(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<OMPRequiresDecl>(D)); break; - case Decl::Typedef: - case Decl::TypeAlias: // using foo = bar; [C++11] - if (CGDebugInfo *DI = getModuleDebugInfo()) - DI->EmitAndRetainType( - getContext().getTypedefType(cast<TypedefNameDecl>(D))); - break; - - case Decl::Record: - if (CGDebugInfo *DI = getModuleDebugInfo()) - if (cast<RecordDecl>(D)->getDefinition()) - DI->EmitAndRetainType(getContext().getRecordType(cast<RecordDecl>(D))); - break; - - case Decl::Enum: - if (CGDebugInfo *DI = getModuleDebugInfo()) - if (cast<EnumDecl>(D)->getDefinition()) - DI->EmitAndRetainType(getContext().getEnumType(cast<EnumDecl>(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 |