diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-02-25 22:46:44 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-02-25 22:46:44 +0000 |
commit | 889b1299a76ae829a6d07135463535b409681585 (patch) | |
tree | 1c38cc1f3bc56681ca4727d37ddc6df13a8ae9ea | |
parent | 35989a76ac4aed266df17ee37eba4a138ff99f34 (diff) | |
download | llvm-889b1299a76ae829a6d07135463535b409681585.tar.gz llvm-889b1299a76ae829a6d07135463535b409681585.tar.bz2 llvm-889b1299a76ae829a6d07135463535b409681585.tar.xz |
DwarfDebug: Avoid emitting an empty debug_aranges section when aranges are disabled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202201 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 3 | ||||
-rw-r--r-- | test/DebugInfo/X86/fission-cu.ll | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index b18e8d49ac..ff5a8213de 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1941,7 +1941,8 @@ void DwarfDebug::emitSectionLabels() { if (useSplitDwarf()) DwarfAbbrevDWOSectionSym = emitSectionSym( Asm, TLOF.getDwarfAbbrevDWOSection(), "section_abbrev_dwo"); - emitSectionSym(Asm, TLOF.getDwarfARangesSection()); + if (GenerateARangeSection) + emitSectionSym(Asm, TLOF.getDwarfARangesSection()); DwarfLineSectionSym = emitSectionSym(Asm, TLOF.getDwarfLineSection(), "section_line"); diff --git a/test/DebugInfo/X86/fission-cu.ll b/test/DebugInfo/X86/fission-cu.ll index 43d36266c8..af179a7a9f 100644 --- a/test/DebugInfo/X86/fission-cu.ll +++ b/test/DebugInfo/X86/fission-cu.ll @@ -1,6 +1,7 @@ ; RUN: llc -split-dwarf=Enable -generate-cu-hash -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s +; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s @a = common global i32 0, align 4 @@ -111,4 +112,6 @@ ; OBJ-NEXT: R_X86_64_32 .debug_str ; OBJ-NEXT: } +; HDR-NOT: .debug_aranges + !9 = metadata !{i32 1, metadata !"Debug Info Version", i32 1} |