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 {
228228 context. freeOperandSet ( bridged)
229229 }
230230}
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 {
150150 self . lazy. filter { !( $0. instruction is I ) }
151151 }
152152
153+ public func ignore( user: Instruction ) -> LazyFilterSequence < Self > {
154+ self . lazy. filter { !( $0. instruction == user) }
155+ }
156+
153157 public func getSingleUser< I: Instruction > ( ofType: I . Type ) -> I ? {
154158 filterUsers ( ofType: I . self) . singleUse? . instruction as? I
155159 }
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ public extension CollectionLikeSequence {
9898 }
9999 return singleElement
100100 }
101+
102+ var first : Element ? { first ( where: { _ in true } ) }
101103}
102104
103105// 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