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

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 06:09:57 PDT 2022


psamolysov 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:
> 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.");
>     ...
>   }
> ```
Looks good, thank you. Maybe the `it` word is unnecessary.


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