[DebugInfo] Do not generate address info for removed debug labels.
authorHsiangkai Wang <hsiangkai@gmail.com>
Tue, 25 Sep 2018 06:09:50 +0000 (06:09 +0000)
committerHsiangkai Wang <hsiangkai@gmail.com>
Tue, 25 Sep 2018 06:09:50 +0000 (06:09 +0000)
commit9c2463622dd58b6b3987fe80509c22f5df02b88c
tree9f0de954cf460fe6fcebef1c686eda02b5c0c05a
parente15248362352c549561cda871bd952842e1db620
[DebugInfo] Do not generate address info for removed debug labels.

In some senario, LLVM will remove llvm.dbg.labels in IR. For example,
when the labels are in unreachable blocks, these labels will not
be generated in LLVM IR. In the case, these debug labels will have
address zero as their address. It is not legal address for debugger to
set breakpoints or query sources. So, the patch inhibits the address info
(DW_AT_low_pc) of removed labels.

Differential Revision: https://reviews.llvm.org/D51908

llvm-svn: 342943
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/test/DebugInfo/Generic/debug-label-unreached.ll [new file with mode: 0644]