[PATCH] D49426: [DEBUG_INFO] fix .loc directives emitted for missing prologues

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 08:54:10 PDT 2018


probinson added a comment.

In https://reviews.llvm.org/D49426#1166535, @dblaikie wrote:

> > However, this particular piece of work addresses what I perceived to be an artefact, a .loc directive for a missing prologue.
>
> I'm not sure it's really a bug here, though - if the assembler addressed the sub-optimality of producing zero-length regions. It seems to me like a natural implementation to change the location, emit the prologue, then change the location again - and if the prologue happens to be empty/zero-length, the correct output falls out naturally. Avoiding special casing the empty prologue keeps the code simple/easier to read/understand, I think.


Intuitively, if we see multiple .loc for the same address, the last one should win.  If we can be sure that ignoring the first .loc is the right solution, in all cases where we find a sequence of .loc directives for the same address, then handling it in the assembler is probably the right fix.

Certainly hand-written assembler can have multiple .loc in a row, and what gas does with this is a fair question.


https://reviews.llvm.org/D49426





More information about the llvm-commits mailing list