Remove wild .debug_aranges entries generated from unimportant labels
authorAlexey Samsonov <samsonov@google.com>
Thu, 3 Oct 2013 08:54:43 +0000 (08:54 +0000)
committerAlexey Samsonov <samsonov@google.com>
Thu, 3 Oct 2013 08:54:43 +0000 (08:54 +0000)
commit9d08d69fd4562a4433cf19eb4b96c17b34f6da2e
treea9c8dcaca15ab59ba57c34be40e46edc10c4dd14
parent198f1b340a71b26f70849db86d72f7b79fd56d03
Remove wild .debug_aranges entries generated from unimportant labels

r191052 added emitting .debug_aranges to Clang, but this
functionality is broken: it uses all MC labels added in DWARF Asm
printer, including the labels for build relocations between
different DWARF sections, like .Lsection_line or .Ldebug_loc0.

As a result, if any DIE .debug_info would contain "DW_AT_location=0x123"
attribute, .debug_aranges would also contain a range starting from 0x123,
breaking tools that rely on this section.

This patch fixes this by using only MC labels that corresponds to the
addresses in the user program.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191884 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll [new file with mode: 0644]