[llvm] 60912f9 - [ADT] Use structured bindings in CoalescingBitVector.h (NFC) (#160976)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 27 09:04:57 PDT 2025


Author: Kazu Hirata
Date: 2025-09-27T09:04:52-07:00
New Revision: 60912f96549e97c5a628418f33f5cd5825944cdd

URL: https://github.com/llvm/llvm-project/commit/60912f96549e97c5a628418f33f5cd5825944cdd
DIFF: https://github.com/llvm/llvm-project/commit/60912f96549e97c5a628418f33f5cd5825944cdd.diff

LOG: [ADT] Use structured bindings in CoalescingBitVector.h (NFC) (#160976)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/CoalescingBitVector.h b/llvm/include/llvm/ADT/CoalescingBitVector.h
index 4940bc1c2c18b..b126fc699ad87 100644
--- a/llvm/include/llvm/ADT/CoalescingBitVector.h
+++ b/llvm/include/llvm/ADT/CoalescingBitVector.h
@@ -194,10 +194,7 @@ template <typename IndexT> class CoalescingBitVector {
 
     // Delete the overlapping intervals. Split up intervals that only partially
     // intersect an overlap.
-    for (IntervalT Overlap : Overlaps) {
-      IndexT OlapStart, OlapStop;
-      std::tie(OlapStart, OlapStop) = Overlap;
-
+    for (auto [OlapStart, OlapStop] : Overlaps) {
       auto It = Intervals.find(OlapStart);
       IndexT CurrStart = It.start();
       IndexT CurrStop = It.stop();
@@ -420,10 +417,7 @@ template <typename IndexT> class CoalescingBitVector {
                               const SmallVectorImpl<IntervalT> &Overlaps,
                               SmallVectorImpl<IntervalT> &NonOverlappingParts) {
     IndexT NextUncoveredBit = Start;
-    for (IntervalT Overlap : Overlaps) {
-      IndexT OlapStart, OlapStop;
-      std::tie(OlapStart, OlapStop) = Overlap;
-
+    for (auto [OlapStart, OlapStop] : Overlaps) {
       // [Start;Stop] and [OlapStart;OlapStop] overlap iff OlapStart <= Stop
       // and Start <= OlapStop.
       bool DoesOverlap = OlapStart <= Stop && Start <= OlapStop;


        


More information about the llvm-commits mailing list