[PATCH] D147506: [DebugLine] save one debug line entry for empty prologue

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 14:38:54 PDT 2023


dblaikie added a comment.

I guess I'll provide the same feedback here as I did on the other one (@aprantl thanks for referencing it/finding the duplicate):

> I'm OK with this change from a "slightly reduces debug info size" but I hesitate to suggest that this isn't a thing your consumer should support & this "When an assembly file with multiple .loc directives with no interveaning instructions are assembled, GAS produces a DWARF line table that maps one instruction to multiple entries." sounds like a bit of a mischaracterization of how I'd read the line table entries in question - I think this line table doesn't "map one instruction to multiple entries" but instead has an empty entry that contains no instructions. Everything between one .loc and the next is at that first location - if there's nothing between them, then nothing is at that location. I suspect that's how other consumers are viewing this situation.
>
> If this is an invariant you want (that there are no zero-length ranges in the line table), maybe it makes sense to implement it as an option in the integrated assembler, rather than special casing this particular instance of zero-length ranges in the line table?
>
> They seem useless enough, but important to reproduce accurately if that's what the assembly says and other assemblers portray that information - but for our own uses we can say "these are meaningless, elide any zero-length location range"?

(do other assemblers reproduce this information? Does anyone care if we preserve it or drop it? My take on it is that this information is meaningless - it describes a location for zero instructions... so dropping it seems fine to me)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147506/new/

https://reviews.llvm.org/D147506



More information about the llvm-commits mailing list