DebugInfo: Do not emit pubnames/pubtypes sections if they are empty

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-03-11 23:35:06 +00:00
parent c4d9cc0e09
commit 1c7fef193f
2 changed files with 5 additions and 2 deletions

View File

@ -2215,6 +2215,9 @@ void DwarfDebug::emitDebugPubSection(
const auto &Globals = (TheU->*Accessor)();
if (Globals.empty())
continue;
if (auto Skeleton = static_cast<DwarfCompileUnit *>(TheU->getSkeleton()))
TheU = Skeleton;
unsigned ID = TheU->getUniqueID();

View File

@ -12,10 +12,10 @@
; CHECK-NOT: file_names[
; CHECK: .debug_pubnames contents:
; CHECK-NEXT: {{^$}}
; CHECK-NOT: Offset
; CHECK: .debug_pubtypes contents:
; CHECK-NEXT: {{^$}}
; CHECK-NOT: Offset
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!5}