OSDN Git Service

[DebugInfo] Do not generate address info for removed debug labels.
authorHsiangkai Wang <hsiangkai@gmail.com>
Wed, 26 Sep 2018 04:19:23 +0000 (04:19 +0000)
committerHsiangkai Wang <hsiangkai@gmail.com>
Wed, 26 Sep 2018 04:19:23 +0000 (04:19 +0000)
commit588325ec092c46dc52429eb76c65fce1ae6e76f9
treedcc583172e80b4becaf12d8d366fbc14ab6c96e6
parent62e9680cdc4b60feddc07404e8a7d1edf99549af
[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.

Fix build failed in BuildBot, clang-stage1-cmake-RA-incremental, on macOS.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343062 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
test/DebugInfo/X86/debug-label-unreached.ll [new file with mode: 0644]