[PATCH] D32177: Using address range map to speedup finding inline stack for address.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 10:42:04 PDT 2017


On Tue, Apr 18, 2017 at 10:34 AM Dehao Chen via Phabricator <
reviews at reviews.llvm.org> wrote:

> danielcdh added inline comments.
>
>
> ================
> Comment at: include/llvm/DebugInfo/DWARF/DWARFUnit.h:140
> +  // Map from range's start address to end address and corresponding DIE.
> +  std::map<uint64_t, std::pair<uint64_t, DWARFDie>> AddrDieMap;
>    typedef iterator_range<std::vector<DWARFDebugInfoEntry>::iterator>
> ----------------
> dblaikie wrote:
> > Would llvm::IntervalMap be more suitable here? (or at least DenseMap,
> perhaps)
> They did not provide upper_bound method.
>

Sorry I'm not quite following why that's needed.

I'm picturing adding all the address ranges, mapped to their DIE offset, to
the interval map. Then looking up the specific address in that map to find
the DIE offset:

  im.insert(0x42, 0x50, 0x<DIE offset>)
  im.insert....
  ...
  if (auto offset = m.lookup(0x48))
    /* do things with 'offset' */
etc...

Does that not line up with the necessary usage in this patch?

>
>
> https://reviews.llvm.org/D32177
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170418/ff1d03fb/attachment.html>


More information about the llvm-commits mailing list