Skip to content

Commit 2572539

Browse files
committed
SIL: add ignore(user:) utility to value-use sequences
1 parent 465ba69 commit 2572539

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SwiftCompilerSources/Sources/SIL/Operand.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)