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

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 14:32:17 PDT 2017


danielcdh added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFUnit.cpp:375
+  auto R = AddrDieMap.upper_bound(Address);
+  if (R == AddrDieMap.begin() || Address >= (--R)->second.first)
+    return DWARFDie();
----------------
dblaikie wrote:
> I'm guessing this should be "std::prev(R)" not "--R" (so as not to modify "R" so that the later return isn't tainted by this modification) - so that this doesn't make the "return R->second.second" produce the wrong answer?
> 
> Is it possible to test this path to make sure the behavior is correct once this is fixed?
This actually dead code as the conditional will always be false. Added assertion there.

Also added the comment to clarify that --R is intended.


https://reviews.llvm.org/D32177





More information about the llvm-commits mailing list