<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 18, 2017 at 10:34 AM Dehao Chen via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">danielcdh added inline comments.<br>
<br>
<br>
================<br>
Comment at: include/llvm/DebugInfo/DWARF/DWARFUnit.h:140<br>
+  // Map from range's start address to end address and corresponding DIE.<br>
+  std::map<uint64_t, std::pair<uint64_t, DWARFDie>> AddrDieMap;<br>
   typedef iterator_range<std::vector<DWARFDebugInfoEntry>::iterator><br>
----------------<br>
dblaikie wrote:<br>
> Would llvm::IntervalMap be more suitable here? (or at least DenseMap, perhaps)<br>
They did not provide upper_bound method.<br></blockquote><div><br>Sorry I'm not quite following why that's needed.<br><br>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:<br><br>  im.insert(0x42, 0x50, 0x<DIE offset>)<br>  im.insert....<br>  ...<br>  if (auto offset = m.lookup(0x48))<br>    /* do things with 'offset' */<br>etc... <br><br>Does that not line up with the necessary usage in this patch?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D32177" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32177</a><br>
<br>
<br>
<br>
</blockquote></div></div>