Do not emit prologue_end for line 0 locs if there is a non-zero loc present
authorAdrian Prantl <aprantl@apple.com>
Thu, 7 Oct 2021 19:58:24 +0000 (12:58 -0700)
committerAdrian Prantl <aprantl@apple.com>
Thu, 7 Oct 2021 20:54:28 +0000 (13:54 -0700)
commit9f93f2bfbd3fedb94490d42e48b89c2a8f05ff0a
treebe2dedd077654602a14ac0f723d5a1c4f8581fa3
parent4651576edd09bb4b0978db8592e938484e7bbd4f
Do not emit prologue_end for line 0 locs if there is a non-zero loc present

This change fixes a bug where the compiler generates a prologue_end
for line 0 locs. That is because line 0 is not associated with any
source location, so there should not be a prolgoue_end at a location
that doesn't correspond to a source location.

There were some LLVM tests that were explicitly checking for line 0
prologue_end's as well since I believe that to be incorrect, I had to
change those tests as well.

Patch by Shubham Rastogi!

Differential Revision: https://reviews.llvm.org/D110740
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/test/CodeGen/X86/line-zero-prologue-end.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/no-non-zero-debug-loc-prologue.ll [new file with mode: 0644]
llvm/test/DebugInfo/MIR/X86/debug-loc-0.mir
llvm/test/DebugInfo/X86/dbg-prolog-end.ll