Skip to content

Commit c4ae7fe

Browse files
committed
move-only: support deinits which get the self argument as indirect argument
This happens for address-only move-only types.
1 parent 7d70a70 commit c4ae7fe

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
@@ -667,6 +667,7 @@ struct ImmutableAddressUseVerifier {
667667
case SILInstructionKind::IndexAddrInst:
668668
case SILInstructionKind::TailAddrInst:
669669
case SILInstructionKind::IndexRawPointerInst:
670+
case SILInstructionKind::MarkMustCheckInst:
670671
// Add these to our worklist.
671672
for (auto result : inst->getResults()) {
672673
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)