Skip to content

Commit f52efde

Browse files
eecksteingottesmm
authored andcommitted
move-only: support deinits which get the self argument as indirect argument
This happens for address-only move-only types. (cherry picked from commit c4ae7fe)
1 parent 9540bbe commit f52efde

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ struct DeallocatorConventions : Conventions {
23852385

23862386
ParameterConvention
23872387
getIndirectSelfParameter(const AbstractionPattern &type) const override {
2388-
llvm_unreachable("Deallocators do not have indirect self parameters");
2388+
return ParameterConvention::Indirect_In;
23892389
}
23902390

23912391
static bool classof(const Conventions *C) {

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ struct ImmutableAddressUseVerifier {
674674
case SILInstructionKind::IndexAddrInst:
675675
case SILInstructionKind::TailAddrInst:
676676
case SILInstructionKind::IndexRawPointerInst:
677+
case SILInstructionKind::MarkMustCheckInst:
677678
// Add these to our worklist.
678679
for (auto result : inst->getResults()) {
679680
llvm::copy(result->getUses(), std::back_inserter(worklist));

lib/SILGen/SILGenProlog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void diagnose(ASTContext &Context, SourceLoc loc, Diag<T...> diag,
4040

4141
SILValue SILGenFunction::emitSelfDeclForDestructor(VarDecl *selfDecl) {
4242
// Emit the implicit 'self' argument.
43-
SILType selfType = getLoweredLoadableType(selfDecl->getType());
43+
SILType selfType = getLoweredType(selfDecl->getType());
4444
SILValue selfValue = F.begin()->createFunctionArgument(selfType, selfDecl);
4545

4646
// If we have a move only type, then mark it with mark_must_check so we can't

0 commit comments

Comments
 (0)