SIL: add a small utility Instruction.isUsing which checks if a value is in its operand list

This commit is contained in:
Erik Eckstein
2025-06-04 09:00:04 +02:00
parent 502c0eb7b0
commit b4010e61a3

View File

@@ -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.