[llvm] 96f9377 - [ADT] Mark IntervalMap::overlaps const

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 15:22:14 PDT 2021


Author: Vedant Kumar
Date: 2021-10-08T15:22:07-07:00
New Revision: 96f937746e19eb9c5152ae9c3d0b36fd8ddccb9c

URL: https://github.com/llvm/llvm-project/commit/96f937746e19eb9c5152ae9c3d0b36fd8ddccb9c
DIFF: https://github.com/llvm/llvm-project/commit/96f937746e19eb9c5152ae9c3d0b36fd8ddccb9c.diff

LOG: [ADT] Mark IntervalMap::overlaps const

This allows the overlaps() predicate to be used on a const IntervalMap.
Tested by building ADTTests, llc, and lldb-test.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/IntervalMap.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h
index 26a7ed0cd3338..3c107a3622a9a 100644
--- a/llvm/include/llvm/ADT/IntervalMap.h
+++ b/llvm/include/llvm/ADT/IntervalMap.h
@@ -1137,7 +1137,7 @@ class IntervalMap {
 
   /// overlaps(a, b) - Return true if the intervals in this map overlap with the
   /// interval [a;b].
-  bool overlaps(KeyT a, KeyT b) {
+  bool overlaps(KeyT a, KeyT b) const {
     assert(Traits::nonEmpty(a, b));
     const_iterator I = find(a);
     if (!I.valid())


        


More information about the llvm-commits mailing list