[PATCH] D125776: [llvm-dva] 01 - Interval tree

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 05:20:46 PDT 2022


CarlosAlbertoEnciso added inline comments.


================
Comment at: llvm/include/llvm/ADT/IntervalTree.h:592
+  IntervalReferences getContaining(PointType Point) const {
+    IntervalReferences IntervalSet;
+    for (find_iterator Iter = find(Point), E = find_end(); Iter != E; ++Iter)
----------------
CarlosAlbertoEnciso wrote:
> psamolysov wrote:
> > Should all the query methods contain an assert that the tree has been actually created?
> I think it is a good idea. I will add some asserts.
Added assertion:

```
  IntervalReferences getContaining(PointType Point) const {
    assert(!empty() && "Interval tree it is not constructed.");
    ...
  }
```


================
Comment at: llvm/include/llvm/ADT/IntervalTree.h:628
+      Points.push_back(Data.right());
+      References.emplace_back(std::addressof(Data));
+    }
----------------
psamolysov wrote:
> To be consistent with 2 lines above.
Changed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125776



More information about the llvm-commits mailing list