jarin added a comment.

Thanks for putting this together, some comments below. Let us see what Pavel 
thinks.



================
Comment at: lldb/include/lldb/Utility/RangeMap.h:634
 
+  // We can treat the vector as a flattened BST, augmenting it with upper 
bounds (max of
+  // range endpoints) for every index allows us to query for intersections in 
O(log n) time.
----------------
BST -> binary search tree


================
Comment at: lldb/include/lldb/Utility/RangeMap.h:642
+  B ComputeUpperBounds(int lo, int hi) {
+    if (lo > hi) return B();
+
----------------
Here, B() should be the min value of type B, no? Perhaps this should be 
`std::numeric_limits<B>::min()` instead of `B()`?


================
Comment at: lldb/include/lldb/Utility/RangeMap.h:745
+  void FindEntryIndexesThatContain(B addr, int lo, int hi,
+                                   std::vector<uint32_t> &indexes) {
+    if (lo > hi) return;
----------------
Hmm, weird, I am surprised this is not `std::vector<T> &indexes` (I realize 
this was in the code before).


================
Comment at: lldb/include/lldb/Utility/RangeMap.h:849
   Compare m_compare;
+  bool upper_bound_computed;
 };
----------------
I am guessing this should have the `m_` prefix?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D74759



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to