[PATCH] D110740: Do not emit prologue_end for line 0 locs if there is a non-zero loc present
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 30 17:47:42 PDT 2021
aprantl added a comment.
Thanks, this LGTM after addressing all of @probinson s comments!
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2097
+ // save off line 0 .loc location and return that if no non-zero location
+ // is found
+ if (MI.getDebugLoc().getLine())
----------------
Maybe we should also explain the rationale behind this:
```
// Scan forward to try to find a non-zero line number. The prologue_end marks the first breakpoint in the function after the frame setup, and a compiler-generated line 0 location is not a meaningful breakpoint. If none is found, return the first location after the frame setup.
```
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2100
+ return MI.getDebugLoc();
+ LineZeroLoc = MI.getDebugLoc();
+ }
----------------
This is also a problem with the original code, but findPrologueEndLoc should probably not scan past the first basic block. Your patch doesn't make this any worse though.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110740/new/
https://reviews.llvm.org/D110740
More information about the llvm-commits
mailing list