Skip to content

Commit e9caee9

Browse files
committed
[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.
1 parent 9f792bd commit e9caee9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/SIL/ApplySite.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ class ApplySite {
297297
getArgumentOperands()[i].set(V);
298298
}
299299

300+
void setCallee(SILValue V) const {
301+
unsigned calleeIndex = getCalleeOperand()->getOperandNumber();
302+
getInstruction()->getAllOperands()[calleeIndex].set(V);
303+
}
304+
300305
/// Return the operand index of the first applied argument.
301306
unsigned getOperandIndexOfFirstArgument() const {
302307
FOREACH_IMPL_RETURN(getArgumentOperandNumber());

0 commit comments

Comments
 (0)