mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AddressLowering] Handle builtins for resumes.
The builtins for resuming UnsafeContinuations traffic in generic values and must be rewritten to use addresses instead of values.
This commit is contained in:
@@ -2930,6 +2930,16 @@ protected:
|
||||
|
||||
void visitBuiltinInst(BuiltinInst *bi) {
|
||||
switch (bi->getBuiltinKind().value_or(BuiltinValueKind::None)) {
|
||||
case BuiltinValueKind::ResumeNonThrowingContinuationReturning: {
|
||||
SILValue opAddr = addrMat.materializeAddress(use->get());
|
||||
bi->setOperand(1, opAddr);
|
||||
break;
|
||||
}
|
||||
case BuiltinValueKind::ResumeThrowingContinuationReturning: {
|
||||
SILValue opAddr = addrMat.materializeAddress(use->get());
|
||||
bi->setOperand(1, opAddr);
|
||||
break;
|
||||
}
|
||||
case BuiltinValueKind::Copy: {
|
||||
SILValue opAddr = addrMat.materializeAddress(use->get());
|
||||
bi->setOperand(0, opAddr);
|
||||
|
||||
Reference in New Issue
Block a user