Skip to content

Commit a18d18e

Browse files
eecksteinkavon
authored andcommitted
move-only: support deinits which get the self argument as indirect argument
This happens for address-only move-only types.
1 parent a5f8956 commit a18d18e

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
@@ -673,6 +673,7 @@ struct ImmutableAddressUseVerifier {
673673
case SILInstructionKind::IndexAddrInst:
674674
case SILInstructionKind::TailAddrInst:
675675
case SILInstructionKind::IndexRawPointerInst:
676+
case SILInstructionKind::MarkMustCheckInst:
676677
// Add these to our worklist.
677678
for (auto result : inst->getResults()) {
678679
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)