mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: add a small utility Instruction.isUsing which checks if a value is in its operand list
This commit is contained in:
@@ -191,6 +191,12 @@ extension Value {
|
||||
public var users: LazyMapSequence<UseList, Instruction> { uses.users }
|
||||
}
|
||||
|
||||
extension Instruction {
|
||||
public func isUsing(_ value: Value) -> Bool {
|
||||
return operands.contains { $0.value == value }
|
||||
}
|
||||
}
|
||||
|
||||
extension Operand {
|
||||
/// Return true if this operation will store a full value into this
|
||||
/// operand's address.
|
||||
|
||||
Reference in New Issue
Block a user