[PATCH] D58952: [llvm] Skip over empty line table entries.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 06:41:12 PST 2019


probinson added a comment.

In D58952#1420777 <https://reviews.llvm.org/D58952#1420777>, @dblaikie wrote:

> In D58952#1420776 <https://reviews.llvm.org/D58952#1420776>, @probinson wrote:
>
> > > I'm not sure I follow this - the line table maps instructions to source locations. If there are no instructions there's nothing to map
> >
> > That's the intent. However, in practice it maps instruction *addresses* to source locations.
>
>
> Well, in practice it's unspecified what it means - so we can look at this and come up with different interpretations. Mine is to interpret these as half open intervals - in which case [100, 100) is empty and you keep searching, then you find [100, 104) and that contains the address you're looking for.


Understood, but if you're walking through the line-number program looking for address 100, and you find it as an exact match, on what grounds do you require the consumer to continue looking?  The consumer does not know the interval is empty unless they keep looking past the exact match. The line-number program opcodes do not tell you about ranges, they only tell you about address-to-source mappings for individual addresses.

Now, if the consumer is fully parsing the line table, and (one assumes) converting to some other internal representation, then they'll find an empty range, and have to figure out what to do with it.  In that case, is throwing away the empty range really always the right thing to do?  Ignoring them for address-to-source mapping seems quite reasonable, but ignoring them for source-to-address mapping ("break on line 12") seems like unnecessarily throwing information away.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58952





More information about the llvm-commits mailing list