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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 16:12:54 PST 2019


dblaikie added a comment.

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.

>   Let's say you have a table that decodes to
> 
>   0x0100  line 12
>   0x0100  line 14
>   0x0104  line 15
> 
> 
> Go through looking for address 0x0100, you get an exact match that returns line 12 (why bother looking ahead to see whether the interval is empty?).
>  But look for address 0x0101 and you get line 14.
> 
> I'm arguing myself into agreeing with you that the extra work to look for a non-empty interval is probably a good thing; however this is something that each consumer will have to understand to do for itself.


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