mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SwiftCompilerSources: add a few utility APIs
This commit is contained in:
@@ -150,6 +150,10 @@ extension Sequence where Element == Operand {
|
||||
self.lazy.filter { !($0.instruction is I) }
|
||||
}
|
||||
|
||||
public func ignore(user: Instruction) -> LazyFilterSequence<Self> {
|
||||
self.lazy.filter { !($0.instruction == user) }
|
||||
}
|
||||
|
||||
public func getSingleUser<I: Instruction>(ofType: I.Type) -> I? {
|
||||
filterUsers(ofType: I.self).singleUse?.instruction as? I
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user