Skip to content

Commit fadff00

Browse files
committed
SwiftCompilerSources: move protocol BridgedRandomAccessCollection from the SIL to the Basic module
1 parent 95c2c50 commit fadff00

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,21 @@ extension BridgedArrayRef {
178178
return c(buffer)
179179
}
180180
}
181+
182+
//===----------------------------------------------------------------------===//
183+
// Sequence Utilities
184+
//===----------------------------------------------------------------------===//
185+
186+
/// RandomAccessCollection which bridges to some C++ array.
187+
///
188+
/// It fixes the default reflection for bridged random access collections, which usually have a
189+
/// `bridged` stored property.
190+
/// Conforming to this protocol displays the "real" children not just `bridged`.
191+
public protocol BridgedRandomAccessCollection : RandomAccessCollection, CustomReflectable {
192+
}
193+
194+
extension BridgedRandomAccessCollection {
195+
public var customMirror: Mirror {
196+
Mirror(self, children: self.map { (label: nil, value: $0 as Any) })
197+
}
198+
}

SwiftCompilerSources/Sources/SIL/Utilities/SequenceUtilities.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,6 @@ extension FormattedLikeArray {
6161
}
6262
}
6363

64-
/// RandomAccessCollection which bridges to some C++ array.
65-
///
66-
/// It fixes the default reflection for bridged random access collections, which usually have a
67-
/// `bridged` stored property.
68-
/// Conforming to this protocol displays the "real" children not just `bridged`.
69-
public protocol BridgedRandomAccessCollection : RandomAccessCollection, CustomReflectable {
70-
}
71-
72-
extension BridgedRandomAccessCollection {
73-
public var customMirror: Mirror {
74-
Mirror(self, children: self.map { (label: nil, value: $0 as Any) })
75-
}
76-
}
77-
7864
/// A Sequence which is not consuming and therefore behaves like a Collection.
7965
///
8066
/// Many sequences in SIL and the optimizer should be collections but cannot

0 commit comments

Comments
 (0)