File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
SwiftCompilerSources/Sources Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -228,3 +228,16 @@ struct OperandSet : IntrusiveSet {
228
228
context. freeOperandSet ( bridged)
229
229
}
230
230
}
231
+
232
+ extension IntrusiveSet {
233
+ mutating func insert( contentsOf source: some Sequence < Element > ) {
234
+ for element in source {
235
+ _ = insert ( element)
236
+ }
237
+ }
238
+
239
+ init ( insertContentsOf source: some Sequence < Element > , _ context: some Context ) {
240
+ self . init ( context)
241
+ insert ( contentsOf: source)
242
+ }
243
+ }
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ extension Sequence where Element == Operand {
150
150
self . lazy. filter { !( $0. instruction is I ) }
151
151
}
152
152
153
+ public func ignore( user: Instruction ) -> LazyFilterSequence < Self > {
154
+ self . lazy. filter { !( $0. instruction == user) }
155
+ }
156
+
153
157
public func getSingleUser< I: Instruction > ( ofType: I . Type ) -> I ? {
154
158
filterUsers ( ofType: I . self) . singleUse? . instruction as? I
155
159
}
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ public extension CollectionLikeSequence {
98
98
}
99
99
return singleElement
100
100
}
101
+
102
+ var first : Element ? { first ( where: { _ in true } ) }
101
103
}
102
104
103
105
// Also make the lazy sequences a CollectionLikeSequence if the underlying sequence is one.
You can’t perform that action at this time.
0 commit comments