mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil] Add a helper on ApplySite to set the ApplySite's SILValue callee in a generic way.
Just so that people do not have to touch operand numbers and potentially make a mistake.
This commit is contained in:
@@ -297,6 +297,11 @@ public:
|
||||
getArgumentOperands()[i].set(V);
|
||||
}
|
||||
|
||||
void setCallee(SILValue V) const {
|
||||
unsigned calleeIndex = getCalleeOperand()->getOperandNumber();
|
||||
getInstruction()->getAllOperands()[calleeIndex].set(V);
|
||||
}
|
||||
|
||||
/// Return the operand index of the first applied argument.
|
||||
unsigned getOperandIndexOfFirstArgument() const {
|
||||
FOREACH_IMPL_RETURN(getArgumentOperandNumber());
|
||||
|
||||
Reference in New Issue
Block a user