Skip to content

Commit 83e39b0

Browse files
Reviewed code comments. Fixed typos and addressed some TODOs
1 parent f239ce8 commit 83e39b0

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,8 +2392,7 @@ static CanSILFunctionType getNativeSILFunctionType(
23922392
// with runtime function. The latter expects 'work' argument to be
23932393
// SWIFT_CC(swift) aka @convention(thin). But the 'self' parameter must
23942394
// remain owned.
2395-
return getSILFunctionTypeForConventions(DeallocatorConventions())
2396-
->getWithExtInfo(SILFunctionType::ExtInfo::getThin());
2395+
return getSILFunctionTypeForConventions(DefaultConventions(NormalParameterConvention::Owned));
23972396
}
23982397

23992398
case SILDeclRef::Kind::AsyncEntryPoint:
@@ -3512,6 +3511,7 @@ TypeConverter::getDeclRefRepresentation(SILDeclRef c) {
35123511
case SILDeclRef::Kind::StoredPropertyInitializer:
35133512
case SILDeclRef::Kind::PropertyWrapperBackingInitializer:
35143513
case SILDeclRef::Kind::PropertyWrapperInitFromProjectedValue:
3514+
case SILDeclRef::Kind::IsolatedDeallocator:
35153515
return SILFunctionTypeRepresentation::Thin;
35163516

35173517
case SILDeclRef::Kind::Func:
@@ -3521,7 +3521,6 @@ TypeConverter::getDeclRefRepresentation(SILDeclRef c) {
35213521

35223522
case SILDeclRef::Kind::Destroyer:
35233523
case SILDeclRef::Kind::Deallocator:
3524-
case SILDeclRef::Kind::IsolatedDeallocator: // TODO: Double-check this
35253524
case SILDeclRef::Kind::Allocator:
35263525
case SILDeclRef::Kind::Initializer:
35273526
case SILDeclRef::Kind::EnumElement:

lib/SILGen/SILGenDestructor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ void SILGenFunction::emitIsolatingDestructor(DestructorDecl *dd) {
301301
B.createConvertFunction(loc, dtx, workFuncType, false);
302302

303303
// Schedule isolated execution
304-
// TODO: Make sure it is a tail call
305304
auto result = B.createApply(loc, swiftPerformOnExecutorFunc, {},
306305
{castedSelf, castedDeallocator, executor});
307306
B.createReturn(loc, result);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,7 @@ static OverrideIsolationResult validOverrideIsolation(
36273627
auto declContext = value->getInnermostDeclContext();
36283628

36293629
// Normally we are checking if overriding declaration can be called by calling
3630-
// overriden declaration But in case of destructors, overriden declaration is
3630+
// overriden declaration. But in case of destructors, overriden declaration is
36313631
// always callable by definition and we are checking that subclas deinit can
36323632
// call super deinit.
36333633
bool isDtor = isa<DestructorDecl>(value);
@@ -3729,7 +3729,8 @@ ActorIsolation ActorIsolationRequest::evaluate(
37293729
assert(actor && "could not find the actor that 'self' is isolated to");
37303730

37313731
// Bootstrapping hack: force _Concurrency.MainActor.deinit() to be
3732-
// non-isolated
3732+
// non-isolated even when importing from SDK's swiftmodule without
3733+
// `nonisolated` attribute.
37333734
if (isa<DestructorDecl>(value) && actor->getName().is("MainActor") &&
37343735
actor->getDeclContext()->isModuleScopeContext() &&
37353736
actor->getDeclContext()->getParentModule()->getABIName().is("Swift")) {

0 commit comments

Comments
 (0)