diff --git a/include/swift/AST/ActorIsolation.h b/include/swift/AST/ActorIsolation.h index 6dba92fdad5f2..6610924887450 100644 --- a/include/swift/AST/ActorIsolation.h +++ b/include/swift/AST/ActorIsolation.h @@ -57,8 +57,19 @@ class ActorIsolation { /// the actor is isolated to the instance of that actor. ActorInstance, /// The declaration is explicitly specified to be not isolated to any actor, - /// meaning that it can be used from any actor but is also unable to - /// refer to the isolated state of any given actor. + /// meaning it cannot itself access actor isolated state but /does/ allow + /// for indirect access to actor isolated state if the declaration can + /// guarantee that all code generated to work with the declaration will run + /// on said actor. + /// + /// E.x.: a nonisolated function can accept actor-isolated values as + /// arguments since the caller knows that it will not escape the values to + /// another isolation domain and that the function will remain on the + /// caller's actor. + /// + /// NOTE: This used to have the meaning of Concurrent which is a stricter + /// definition of nonisolated that prevents the code generated to work with + /// the declaration to never touch actor isolated state. Nonisolated, /// The declaration is explicitly specified to be not isolated and with the /// "unsafe" annotation, which means that we do not enforce isolation. @@ -69,11 +80,20 @@ class ActorIsolation { /// The actor isolation iss statically erased, as for a call to /// an isolated(any) function. This is not possible for declarations. Erased, - /// Inherits isolation from the caller of the given function. + /// The declaration is explicitly specified to be not isolated to any actor, + /// meaning that it can be used from any actor but is also unable to + /// refer to the isolated state of any given actor. /// - /// DISCUSSION: This is used for nonisolated asynchronous functions that we - /// want to inherit from their context the context's actor isolation. - CallerIsolationInheriting, + /// NOTE: This used to be nonisolated, but we changed nonisolated to have a + /// weaker definition of nonisolated that allows for actor isolated state to + /// be manipulated by code generated to work with the actor as long as all + /// such code generation is guaranteed to always run on whatever actor + /// isolation it is invoked in consistently and not escape the value to any + /// other isolation domain. + Concurrent, + /// The declaration is explicitly specified to be concurrent and with the + /// "unsafe" annotation, which means that we do not enforce isolation. + ConcurrentUnsafe, }; private: @@ -88,7 +108,7 @@ class ActorIsolation { /// Set to true if this was parsed from SIL. unsigned silParsed : 1; - unsigned parameterIndex : 27; + unsigned parameterIndex : 26; ActorIsolation(Kind kind, NominalTypeDecl *actor, unsigned parameterIndex); @@ -112,10 +132,8 @@ class ActorIsolation { return ActorIsolation(unsafe ? NonisolatedUnsafe : Nonisolated); } - static ActorIsolation forCallerIsolationInheriting() { - // NOTE: We do not use parameter indices since the parameter is implicit - // from the perspective of the AST. - return ActorIsolation(CallerIsolationInheriting); + static ActorIsolation forConcurrent(bool unsafe) { + return ActorIsolation(unsafe ? ConcurrentUnsafe : Concurrent); } static ActorIsolation forActorInstanceSelf(ValueDecl *decl); @@ -165,9 +183,10 @@ class ActorIsolation { std::optional(ActorIsolation::GlobalActor)) .Case("global_actor_unsafe", std::optional(ActorIsolation::GlobalActor)) - .Case("caller_isolation_inheriting", - std::optional( - ActorIsolation::CallerIsolationInheriting)) + .Case("concurrent", + std::optional(ActorIsolation::Concurrent)) + .Case("concurrent_unsafe", std::optional( + ActorIsolation::ConcurrentUnsafe)) .Default(std::nullopt); if (kind == std::nullopt) return std::nullopt; @@ -180,11 +199,17 @@ class ActorIsolation { bool isUnspecified() const { return kind == Unspecified; } + bool isConcurrent() const { + return (kind == Concurrent) || (kind == ConcurrentUnsafe); + } + bool isNonisolated() const { return (kind == Nonisolated) || (kind == NonisolatedUnsafe); } - bool isNonisolatedUnsafe() const { return kind == NonisolatedUnsafe; } + bool isUnsafe() const { + return kind == NonisolatedUnsafe || kind == ConcurrentUnsafe; + } /// Retrieve the parameter to which actor-instance isolation applies. /// @@ -212,7 +237,8 @@ class ActorIsolation { case Unspecified: case Nonisolated: case NonisolatedUnsafe: - case CallerIsolationInheriting: + case Concurrent: + case ConcurrentUnsafe: return false; } } diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index a93d4327790a1..037e8aaa28e10 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -3844,18 +3844,19 @@ class PrintExpr : public ExprVisitor, switch (auto isolation = E->getActorIsolation()) { case ActorIsolation::Unspecified: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Nonisolated: printFlag(true, "nonisolated", CapturesColor); break; - case ActorIsolation::Erased: - printFlag(true, "dynamically_isolated", CapturesColor); + case ActorIsolation::Concurrent: + printFlag(true, "concurrent", CapturesColor); break; - case ActorIsolation::CallerIsolationInheriting: - printFlag(true, "isolated_to_caller_isolation", CapturesColor); + case ActorIsolation::Erased: + printFlag(true, "dynamically_isolated", CapturesColor); break; case ActorIsolation::ActorInstance: diff --git a/lib/AST/ActorIsolation.cpp b/lib/AST/ActorIsolation.cpp index 19c06555a08da..1302587c573f1 100644 --- a/lib/AST/ActorIsolation.cpp +++ b/lib/AST/ActorIsolation.cpp @@ -39,7 +39,10 @@ ActorIsolation::ActorIsolation(Kind kind, Expr *actor, unsigned parameterIndex) ActorIsolation::ActorIsolation(Kind kind, Type globalActor) : globalActor(globalActor), kind(kind), isolatedByPreconcurrency(false), - silParsed(false), parameterIndex(0) {} + silParsed(false), parameterIndex(0) { + assert((silParsed || globalActor) && + "If we are not sil parsed, global actor must be a real type"); +} ActorIsolation ActorIsolation::forActorInstanceParameter(Expr *actor, @@ -49,7 +52,7 @@ ActorIsolation::forActorInstanceParameter(Expr *actor, // An isolated value of `nil` is statically nonisolated. // FIXME: Also allow 'Optional.none' if (isa(actor)) - return ActorIsolation::forNonisolated(/*unsafe*/ false); + return ActorIsolation::forConcurrent(/*unsafe*/ false); // An isolated value of `.shared` is statically // global actor isolated. @@ -162,8 +165,8 @@ bool ActorIsolation::isEqual(const ActorIsolation &lhs, return false; switch (lhs.getKind()) { - case Nonisolated: - case NonisolatedUnsafe: + case Concurrent: + case ConcurrentUnsafe: case Unspecified: return true; @@ -174,7 +177,8 @@ bool ActorIsolation::isEqual(const ActorIsolation &lhs, // to answer. return false; - case CallerIsolationInheriting: + case Nonisolated: + case NonisolatedUnsafe: // This returns false for the same reason as erased. The caller has to check // against the actual caller isolation. return false; diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 455238c123cca..0e0946253fa55 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2757,6 +2757,7 @@ static bool deferMatchesEnclosingAccess(const FuncDecl *defer) { switch (isolation) { case ActorIsolation::Unspecified: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::GlobalActor: @@ -2765,9 +2766,9 @@ static bool deferMatchesEnclosingAccess(const FuncDecl *defer) { return true; - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::ActorInstance: case ActorIsolation::Nonisolated: + case ActorIsolation::Concurrent: case ActorIsolation::Erased: // really can't happen return true; } @@ -11458,9 +11459,10 @@ bool VarDecl::isSelfParamCaptureIsolated() const { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::GlobalActor: case ActorIsolation::Erased: - case ActorIsolation::CallerIsolationInheriting: return false; case ActorIsolation::ActorInstance: diff --git a/lib/AST/TypeCheckRequests.cpp b/lib/AST/TypeCheckRequests.cpp index 76fddad8ec7a6..37487a8fbff0b 100644 --- a/lib/AST/TypeCheckRequests.cpp +++ b/lib/AST/TypeCheckRequests.cpp @@ -1856,10 +1856,11 @@ SourceLoc MacroDefinitionRequest::getNearestLoc() const { bool ActorIsolation::requiresSubstitution() const { switch (kind) { - case CallerIsolationInheriting: case ActorInstance: case Nonisolated: case NonisolatedUnsafe: + case Concurrent: + case ConcurrentUnsafe: case Unspecified: return false; @@ -1872,9 +1873,10 @@ bool ActorIsolation::requiresSubstitution() const { ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const { switch (kind) { case ActorInstance: - case CallerIsolationInheriting: case Nonisolated: case NonisolatedUnsafe: + case Concurrent: + case ConcurrentUnsafe: case Unspecified: return *this; @@ -1893,11 +1895,6 @@ void ActorIsolation::printForDiagnostics(llvm::raw_ostream &os, os << "actor" << (asNoun ? " isolation" : "-isolated"); break; - case ActorIsolation::CallerIsolationInheriting: - os << "caller isolation inheriting" - << (asNoun ? " isolation" : "-isolated"); - break; - case ActorIsolation::GlobalActor: { if (isMainActor()) { os << "main actor" << (asNoun ? " isolation" : "-isolated"); @@ -1912,11 +1909,13 @@ void ActorIsolation::printForDiagnostics(llvm::raw_ostream &os, os << "@isolated(any)"; break; + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: case ActorIsolation::Unspecified: os << "nonisolated"; - if (*this == ActorIsolation::NonisolatedUnsafe) { + if (isUnsafe()) { os << "(unsafe)"; } break; @@ -1934,15 +1933,18 @@ void ActorIsolation::print(llvm::raw_ostream &os) const { os << ". name: '" << vd->getBaseIdentifier() << "'"; } return; - case CallerIsolationInheriting: - os << "caller_isolation_inheriting"; - return; case Nonisolated: os << "nonisolated"; return; case NonisolatedUnsafe: os << "nonisolated_unsafe"; return; + case Concurrent: + os << "concurrent"; + return; + case ConcurrentUnsafe: + os << "concurrent_unsafe"; + return; case GlobalActor: os << "global_actor. type: " << getGlobalActor(); return; @@ -1961,15 +1963,18 @@ void ActorIsolation::printForSIL(llvm::raw_ostream &os) const { case ActorInstance: os << "actor_instance"; return; - case CallerIsolationInheriting: - os << "caller_isolation_inheriting"; - return; case Nonisolated: os << "nonisolated"; return; case NonisolatedUnsafe: os << "nonisolated_unsafe"; return; + case Concurrent: + os << "concurrent"; + return; + case ConcurrentUnsafe: + os << "concurrent_unsafe"; + return; case GlobalActor: os << "global_actor"; return; @@ -2009,14 +2014,12 @@ void swift::simple_display( } break; - case ActorIsolation::CallerIsolationInheriting: - out << "isolated to isolation of caller"; - break; - case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: out << "nonisolated"; - if (state == ActorIsolation::NonisolatedUnsafe) { + if (state.isUnsafe()) { out << "(unsafe)"; } break; diff --git a/lib/IDE/CompletionLookup.cpp b/lib/IDE/CompletionLookup.cpp index ec83327cc502f..28c46ca34e65a 100644 --- a/lib/IDE/CompletionLookup.cpp +++ b/lib/IDE/CompletionLookup.cpp @@ -827,8 +827,9 @@ void CompletionLookup::analyzeActorIsolation( break; case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return; } } diff --git a/lib/SIL/IR/SILFunctionType.cpp b/lib/SIL/IR/SILFunctionType.cpp index ddfa98459e831..e3f4094b7696e 100644 --- a/lib/SIL/IR/SILFunctionType.cpp +++ b/lib/SIL/IR/SILFunctionType.cpp @@ -1651,8 +1651,7 @@ class DestructureInputs { // enabled. if (TC.Context.LangOpts.hasFeature( Feature::NonIsolatedAsyncInheritsIsolationFromContext) && - IsolationInfo && - IsolationInfo->getKind() == ActorIsolation::CallerIsolationInheriting && + IsolationInfo && IsolationInfo->isNonisolated() && extInfoBuilder.isAsync()) { auto actorProtocol = TC.Context.getProtocol(KnownProtocolKind::Actor); auto actorType = @@ -2530,15 +2529,15 @@ static CanSILFunctionType getSILFunctionType( std::optional actorIsolation; if (constant) { if (constant->kind == SILDeclRef::Kind::Deallocator) { - actorIsolation = ActorIsolation::forNonisolated(false); + actorIsolation = ActorIsolation::forConcurrent(false); } else if (auto *decl = constant->getAbstractFunctionDecl(); decl && decl->getExecutionBehavior().has_value()) { switch (*decl->getExecutionBehavior()) { case ExecutionKind::Concurrent: - actorIsolation = ActorIsolation::forNonisolated(false /*unsafe*/); + actorIsolation = ActorIsolation::forConcurrent(false /*unsafe*/); break; case ExecutionKind::Caller: - actorIsolation = ActorIsolation::forCallerIsolationInheriting(); + actorIsolation = ActorIsolation::forNonisolated(false /*unsafe*/); break; } } else { diff --git a/lib/SILGen/SILGen.cpp b/lib/SILGen/SILGen.cpp index c3de2d634ffd7..b8e4e3ffaade6 100644 --- a/lib/SILGen/SILGen.cpp +++ b/lib/SILGen/SILGen.cpp @@ -735,7 +735,7 @@ static ActorIsolation getActorIsolationForFunction(SILFunction &fn) { if (constant.kind == SILDeclRef::Kind::Deallocator) { // Deallocating destructor is always nonisolated. Isolation of the deinit // applies only to isolated deallocator and destroyer. - return ActorIsolation::forNonisolated(false); + return ActorIsolation::forConcurrent(false); } // If we have actor isolation for our constant, put the isolation onto the diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index 9dc44624610fa..dcdec1d473395 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -3104,8 +3104,9 @@ static void emitDelayedArguments(SILGenFunction &SGF, case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: llvm_unreachable("Not isolated"); } @@ -5832,8 +5833,9 @@ RValue SILGenFunction::emitApply( case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: llvm_unreachable("Not isolated"); break; } diff --git a/lib/SILGen/SILGenConcurrency.cpp b/lib/SILGen/SILGenConcurrency.cpp index 2f541b0e79a99..45dd049f305cf 100644 --- a/lib/SILGen/SILGenConcurrency.cpp +++ b/lib/SILGen/SILGenConcurrency.cpp @@ -73,7 +73,7 @@ setExpectedExecutorForParameterIsolation(SILGenFunction &SGF, // If we have caller isolation inheriting... just grab from our isolated // argument. - if (actorIsolation.getKind() == ActorIsolation::CallerIsolationInheriting) { + if (actorIsolation.isNonisolated()) { if (auto *isolatedArg = SGF.F.maybeGetIsolatedArgument()) { ManagedValue isolatedMV; if (isolatedArg->getOwnershipKind() == OwnershipKind::Guaranteed) { @@ -106,10 +106,11 @@ void SILGenFunction::emitExpectedExecutorProlog() { // the instance properties of the class. return false; + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: case ActorIsolation::Unspecified: - case ActorIsolation::CallerIsolationInheriting: return false; case ActorIsolation::Erased: @@ -163,8 +164,8 @@ void SILGenFunction::emitExpectedExecutorProlog() { auto actorIsolation = getActorIsolation(funcDecl); switch (actorIsolation.getKind()) { case ActorIsolation::Unspecified: - case ActorIsolation::Nonisolated: - case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: @@ -187,7 +188,8 @@ void SILGenFunction::emitExpectedExecutorProlog() { break; } - case ActorIsolation::CallerIsolationInheriting: + case ActorIsolation::Nonisolated: + case ActorIsolation::NonisolatedUnsafe: assert(F.isAsync()); setExpectedExecutorForParameterIsolation(*this, actorIsolation); break; @@ -205,8 +207,9 @@ void SILGenFunction::emitExpectedExecutorProlog() { switch (actorIsolation.getKind()) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: @@ -633,8 +636,9 @@ SILGenFunction::emitClosureIsolation(SILLocation loc, SILDeclRef constant, switch (isolation) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return emitNonIsolatedIsolation(loc); case ActorIsolation::Erased: @@ -685,8 +689,9 @@ SILGenFunction::emitExecutor(SILLocation loc, ActorIsolation isolation, switch (isolation.getKind()) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return std::nullopt; case ActorIsolation::Erased: @@ -716,6 +721,8 @@ void SILGenFunction::emitHopToActorValue(SILLocation loc, ManagedValue actor) { }); if (isolation != ActorIsolation::Nonisolated && isolation != ActorIsolation::NonisolatedUnsafe && + isolation != ActorIsolation::Concurrent && + isolation != ActorIsolation::ConcurrentUnsafe && isolation != ActorIsolation::Unspecified) { // TODO: Explicit hop with no hop-back should only be allowed in nonisolated // async functions. But it needs work for any closure passed to diff --git a/lib/SILGen/SILGenConstructor.cpp b/lib/SILGen/SILGenConstructor.cpp index 4348aff2ad427..f1cd12955e532 100644 --- a/lib/SILGen/SILGenConstructor.cpp +++ b/lib/SILGen/SILGenConstructor.cpp @@ -603,8 +603,9 @@ static bool ctorHopsInjectedByDefiniteInit(ConstructorDecl *ctor, case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::GlobalActor: - case ActorIsolation::CallerIsolationInheriting: return false; } } @@ -1558,7 +1559,8 @@ void SILGenFunction::emitMemberInitializer(DeclContext *dc, VarDecl *selfDecl, case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: - case ActorIsolation::CallerIsolationInheriting: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: diff --git a/lib/SILGen/SILGenFunction.cpp b/lib/SILGen/SILGenFunction.cpp index 8038915d1ba1e..ab1f16b5561d1 100644 --- a/lib/SILGen/SILGenFunction.cpp +++ b/lib/SILGen/SILGenFunction.cpp @@ -1097,8 +1097,9 @@ SILGenFunction::emitClosureValue(SILLocation loc, SILDeclRef constant, switch (actorIsolation) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::ActorInstance: break; diff --git a/lib/SILOptimizer/Analysis/RegionAnalysis.cpp b/lib/SILOptimizer/Analysis/RegionAnalysis.cpp index 189be6a8ffcf0..7088481292308 100644 --- a/lib/SILOptimizer/Analysis/RegionAnalysis.cpp +++ b/lib/SILOptimizer/Analysis/RegionAnalysis.cpp @@ -2430,7 +2430,7 @@ class PartitionOpTranslator { // locations (which is how we grab our AST information). !(applyExpr && applyExpr->getIsolationCrossing() ->getCalleeIsolation() - .isNonisolated()); + .isConcurrent()); for (auto result : applyResults) { if (auto value = tryToTrackValue(result)) { diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index ca1c3e6274112..1e01afe4bf0d8 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -1067,8 +1067,9 @@ void LifetimeChecker::injectActorHops() { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::GlobalActor: return; } diff --git a/lib/SILOptimizer/Mandatory/FlowIsolation.cpp b/lib/SILOptimizer/Mandatory/FlowIsolation.cpp index 26cd098062d61..49b751f12067e 100644 --- a/lib/SILOptimizer/Mandatory/FlowIsolation.cpp +++ b/lib/SILOptimizer/Mandatory/FlowIsolation.cpp @@ -12,18 +12,17 @@ #define DEBUG_TYPE "flow-isolation" -#include "llvm/Support/WithColor.h" -#include "swift/AST/Expr.h" -#include "swift/AST/ActorIsolation.h" #include "swift/AST/DiagnosticsSIL.h" +#include "swift/AST/Expr.h" #include "swift/Basic/Assertions.h" -#include "swift/Sema/Concurrency.h" #include "swift/SIL/ApplySite.h" -#include "swift/SIL/BitDataflow.h" #include "swift/SIL/BasicBlockBits.h" -#include "swift/SIL/DebugUtils.h" #include "swift/SIL/BasicBlockDatastructures.h" +#include "swift/SIL/BitDataflow.h" +#include "swift/SIL/DebugUtils.h" #include "swift/SILOptimizer/PassManager/Transforms.h" +#include "swift/Sema/Concurrency.h" +#include "llvm/Support/WithColor.h" using namespace swift; diff --git a/lib/SILOptimizer/Utils/SILIsolationInfo.cpp b/lib/SILOptimizer/Utils/SILIsolationInfo.cpp index e3697195ef0ee..d8e82a39b4804 100644 --- a/lib/SILOptimizer/Utils/SILIsolationInfo.cpp +++ b/lib/SILOptimizer/Utils/SILIsolationInfo.cpp @@ -96,7 +96,7 @@ class DeclRefExprAnalysis { if (auto *mri = dyn_cast(expr)) { if (mri->hasDecl()) { auto isolation = swift::getActorIsolation(mri->getDecl().getDecl()); - if (isolation.isNonisolatedUnsafe()) + if (isolation.isUnsafe()) return true; } } @@ -485,17 +485,16 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { if (nomDecl->isAnyActor()) return SILIsolationInfo::getActorInstanceIsolated(rei, rei->getOperand(), nomDecl) - .withUnsafeNonIsolated(varIsolation.isNonisolatedUnsafe()); + .withUnsafeNonIsolated(varIsolation.isUnsafe()); if (auto isolation = swift::getActorIsolation(nomDecl)) { assert(isolation.isGlobalActor()); return SILIsolationInfo::getGlobalActorIsolated( rei, isolation.getGlobalActor()) - .withUnsafeNonIsolated(varIsolation.isNonisolatedUnsafe()); + .withUnsafeNonIsolated(varIsolation.isUnsafe()); } - return SILIsolationInfo::getDisconnected( - varIsolation.isNonisolatedUnsafe()); + return SILIsolationInfo::getDisconnected(varIsolation.isUnsafe()); } // Check if we have a global_addr inst. @@ -508,7 +507,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { ga, isolation.getGlobalActor()); } - if (isolation.isNonisolatedUnsafe()) { + if (isolation.isUnsafe()) { return SILIsolationInfo::getDisconnected( true /*is nonisolated(unsafe)*/); } @@ -545,7 +544,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { } // Then check if we have something that is nonisolated unsafe. - if (isolation.isNonisolatedUnsafe()) { + if (isolation.isUnsafe()) { // First check if our function_ref is a method of a global actor // isolated type. In such a case, we create a global actor isolated // nonisolated(unsafe) so that if we assign the value to another @@ -624,7 +623,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { // Check if we have a global actor and handle it appropriately. if (isolation.getKind() == ActorIsolation::GlobalActor) { bool localNonIsolatedUnsafe = - isNonIsolatedUnsafe | isolation.isNonisolatedUnsafe(); + isNonIsolatedUnsafe | isolation.isUnsafe(); return SILIsolationInfo::getGlobalActorIsolated( cmi, isolation.getGlobalActor()) .withUnsafeNonIsolated(localNonIsolatedUnsafe); @@ -634,7 +633,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { if (isolation.getKind() != ActorIsolation::ActorInstance && isolation.isActorInstanceForSelfParameter()) { bool localNonIsolatedUnsafe = - isNonIsolatedUnsafe | isolation.isNonisolatedUnsafe(); + isNonIsolatedUnsafe | isolation.isUnsafe(); return SILIsolationInfo::getActorInstanceIsolated( cmi, cmi->getOperand(), cmi->getOperand() @@ -651,7 +650,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { // Check if we have a global actor and handle it appropriately. if (isolation.getKind() == ActorIsolation::GlobalActor) { bool localNonIsolatedUnsafe = - isNonIsolatedUnsafe | isolation.isNonisolatedUnsafe(); + isNonIsolatedUnsafe | isolation.isUnsafe(); return SILIsolationInfo::getGlobalActorIsolated( cmi, isolation.getGlobalActor()) .withUnsafeNonIsolated(localNonIsolatedUnsafe); @@ -661,7 +660,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { if (isolation.getKind() != ActorIsolation::ActorInstance && isolation.isActorInstanceForSelfParameter()) { bool localNonIsolatedUnsafe = - isNonIsolatedUnsafe | isolation.isNonisolatedUnsafe(); + isNonIsolatedUnsafe | isolation.isUnsafe(); return SILIsolationInfo::getActorInstanceIsolated( cmi, cmi->getOperand(), cmi->getOperand() @@ -684,20 +683,16 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { auto varIsolation = swift::getActorIsolation(sei->getField()); if (auto isolation = SILIsolationInfo::getGlobalActorIsolated(sei, sei->getStructDecl())) - return isolation.withUnsafeNonIsolated( - varIsolation.isNonisolatedUnsafe()); - return SILIsolationInfo::getDisconnected( - varIsolation.isNonisolatedUnsafe()); + return isolation.withUnsafeNonIsolated(varIsolation.isUnsafe()); + return SILIsolationInfo::getDisconnected(varIsolation.isUnsafe()); } if (auto *seai = dyn_cast(inst)) { auto varIsolation = swift::getActorIsolation(seai->getField()); if (auto isolation = SILIsolationInfo::getGlobalActorIsolated( seai, seai->getStructDecl())) - return isolation.withUnsafeNonIsolated( - varIsolation.isNonisolatedUnsafe()); - return SILIsolationInfo::getDisconnected( - varIsolation.isNonisolatedUnsafe()); + return isolation.withUnsafeNonIsolated(varIsolation.isUnsafe()); + return SILIsolationInfo::getDisconnected(varIsolation.isUnsafe()); } // See if we have an unchecked_enum_data from a global actor isolated type. @@ -775,7 +770,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { if (asi->isFromVarDecl()) { if (auto *varDecl = asi->getLoc().getAsASTNode()) { auto isolation = swift::getActorIsolation(varDecl); - if (isolation.getKind() == ActorIsolation::NonisolatedUnsafe) { + if (isolation.isUnsafe()) { return SILIsolationInfo::getDisconnected( true /*is nonisolated(unsafe)*/); } @@ -795,7 +790,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { if (auto *dbg = dyn_cast(debugInfo->getUser())) { if (auto *varDecl = dbg->getLoc().getAsASTNode()) { auto isolation = swift::getActorIsolation(varDecl); - if (isolation.getKind() == ActorIsolation::NonisolatedUnsafe) { + if (isolation.isUnsafe()) { return SILIsolationInfo::getDisconnected( true /*is nonisolated(unsafe)*/); } @@ -816,7 +811,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) { // caused by the actor instances not matching. if (ApplyExpr *apply = inst->getLoc().getAsASTNode()) { if (auto crossing = apply->getIsolationCrossing()) { - if (crossing->getCalleeIsolation().isNonisolated()) { + if (crossing->getCalleeIsolation().isConcurrent()) { return SILIsolationInfo::getDisconnected(false /*nonisolated(unsafe)*/); } } diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp index 247485bb95582..f2788093bdf76 100644 --- a/lib/Sema/ConstraintSystem.cpp +++ b/lib/Sema/ConstraintSystem.cpp @@ -5108,8 +5108,9 @@ ConstraintSystem::inferKeyPathLiteralCapability(KeyPathExpr *keyPath) { switch (getActorIsolation(storage)) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 8df065e5641ae..bcea0cbf9eba5 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -116,12 +116,10 @@ static bool requiresFlowIsolation(ActorIsolation typeIso, case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return false; - // TODO: We probably want constructors to always be truly non-isolated. - case ActorIsolation::CallerIsolationInheriting: - llvm_unreachable("constructor cannot have nonisolated implicit actor " - "instance isolation"); case ActorIsolation::Erased: llvm_unreachable("constructor cannot have erased isolation"); @@ -527,7 +525,7 @@ static bool varIsSafeAcrossActors(const ModuleDecl *fromModule, VarDecl *var, bool accessWithinModule = (fromModule == var->getDeclContext()->getParentModule()); - if (varIsolation.getKind() == ActorIsolation::NonisolatedUnsafe) + if (varIsolation.isUnsafe()) return true; if (!var->isLet()) { @@ -536,7 +534,7 @@ static bool varIsSafeAcrossActors(const ModuleDecl *fromModule, VarDecl *var, if (dyn_cast_or_null(var->getDeclContext()->getAsDecl()) && !var->isStatic() && var->hasStorage() && var->getTypeInContext()->isSendableType()) { - if (accessWithinModule || varIsolation.isNonisolated()) + if (accessWithinModule || varIsolation.isConcurrent()) return true; } // Otherwise, must be immutable. @@ -546,13 +544,12 @@ static bool varIsSafeAcrossActors(const ModuleDecl *fromModule, VarDecl *var, switch (varIsolation) { case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: // if nonisolated, it's OK return true; - case ActorIsolation::CallerIsolationInheriting: - return false; - case ActorIsolation::Erased: llvm_unreachable("variable cannot have erased isolation"); @@ -1742,12 +1739,11 @@ static bool wasLegacyEscapingUseRestriction(AbstractFunctionDecl *fn) { return false; case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: assert(!fn->hasAsync()); return true; - case ActorIsolation::CallerIsolationInheriting: - llvm_unreachable( - "destructor decl cannot have non implicit actor instance isolation"); case ActorIsolation::Erased: llvm_unreachable("destructor decl cannot have erased isolation"); } @@ -1755,6 +1751,8 @@ static bool wasLegacyEscapingUseRestriction(AbstractFunctionDecl *fn) { switch (isolationKind) { case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::GlobalActor: // convenience inits did not have the restriction. if (ctor->isConvenienceInit()) @@ -1766,9 +1764,6 @@ static bool wasLegacyEscapingUseRestriction(AbstractFunctionDecl *fn) { return false; case ActorIsolation::Erased: llvm_unreachable("constructor decl cannot have erased isolation"); - case ActorIsolation::CallerIsolationInheriting: - llvm_unreachable( - "constructor decl cannot have caller isolation inheriting isolation"); case ActorIsolation::Unspecified: // this is basically just objc-marked inits. @@ -2026,10 +2021,11 @@ static ActorIsolation getInnermostIsolatedContext( auto mutableDC = const_cast(dc); switch (auto isolation = getActorIsolationOfContext(mutableDC, getClosureActorIsolation)) { - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::ActorInstance: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: return isolation; @@ -2401,11 +2397,12 @@ namespace { (!fn->isAsyncContext() || fn != dc)) { switch (getActorIsolation(fn)) { case ActorIsolation::ActorInstance: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::GlobalActor: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: - return false; + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: + return false; case ActorIsolation::Erased: llvm_unreachable("function cannot have erased isolation"); @@ -2724,7 +2721,7 @@ namespace { // new refinement. auto isolation = requiredIsolation.find(dc); if (isolation == requiredIsolation.end() || - isolation->second == ActorIsolation::Nonisolated) { + isolation->second == ActorIsolation::Concurrent) { requiredIsolation[dc] = refinedIsolation; } else if (isolation->second != refinedIsolation) { dc->getASTContext().Diags.diagnose( @@ -2759,11 +2756,8 @@ namespace { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: - return; - - // Similarly to Nonisolated, caller inheriting isolation because we will - // inherit from the context. - case ActorIsolation::CallerIsolationInheriting: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return; case ActorIsolation::Erased: @@ -2819,7 +2813,7 @@ namespace { // 'Sendable' closures because they can be accessed from anywhere. // Note that only 'nonisolated(unsafe)' can be applied to local // variables. - if (isolation.isNonisolated()) + if (isolation.isConcurrent()) continue; auto *context = localFunc.getAsDeclContext(); @@ -3251,8 +3245,9 @@ namespace { switch (isolation) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: if (closure->isSendable()) { return ReferencedActor(var, isPotentiallyIsolated, ReferencedActor::SendableClosure); } @@ -3310,9 +3305,10 @@ namespace { // while general isolation is declaration-based. switch (auto isolation = getActorIsolationOfContext(dc, getClosureActorIsolation)) { - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: // Local functions can capture an isolated parameter. // FIXME: This really should be modeled by getActorIsolationOfContext. @@ -3722,7 +3718,7 @@ namespace { case ActorReferenceResult::ExitsActorToNonisolated: unsatisfiedIsolation = - ActorIsolation::forNonisolated(/*unsafe=*/false); + ActorIsolation::forConcurrent(/*unsafe=*/false); break; case ActorReferenceResult::EntersActor: @@ -3776,7 +3772,7 @@ namespace { const_cast(arg->findOriginalValue()), paramIdx); if (getContextIsolation() != calleeIsolation) { - if (calleeIsolation.isNonisolated()) { + if (calleeIsolation.isConcurrent()) { mayExitToNonisolated = true; } else { unsatisfiedIsolation = calleeIsolation; @@ -3793,7 +3789,7 @@ namespace { // an isolated context, then we're exiting the actor context. if (mayExitToNonisolated && fnType->isAsync() && getContextIsolation().isActorIsolated()) - unsatisfiedIsolation = ActorIsolation::forNonisolated(/*unsafe=*/false); + unsatisfiedIsolation = ActorIsolation::forConcurrent(/*unsafe=*/false); // If there was no unsatisfied actor isolation, we're done. if (!unsatisfiedIsolation) @@ -4018,8 +4014,9 @@ namespace { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: actorExpr = new (ctx) NilLiteralExpr(loc, /*implicit=*/false); break; } @@ -4158,8 +4155,9 @@ namespace { decl, getDeclContext()); switch (isolation) { case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: break; @@ -4368,8 +4366,9 @@ namespace { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: refKind = ReferencedActor::NonIsolatedContext; break; } @@ -4481,7 +4480,7 @@ namespace { if (auto *attr = explicitClosure->getAttrs().getAttribute(); attr && ctx.LangOpts.hasFeature(Feature::ClosureIsolation)) { - return ActorIsolation::forNonisolated(attr->isUnsafe()) + return ActorIsolation::forConcurrent(attr->isUnsafe()) .withPreconcurrency(preconcurrency); } } @@ -4502,7 +4501,7 @@ namespace { // safe to rely on this path to handle Sendable closures. if (isIsolationInferenceBoundaryClosure( closure, /*canInheritActorContext*/true)) - return ActorIsolation::forNonisolated(/*unsafe=*/false) + return ActorIsolation::forConcurrent(/*unsafe=*/false) .withPreconcurrency(preconcurrency); // A non-Sendable closure gets its isolation from its context. @@ -4512,12 +4511,12 @@ namespace { // We must have parent isolation determined to get here. switch (parentIsolation) { - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: - return ActorIsolation::forNonisolated(parentIsolation == - ActorIsolation::NonisolatedUnsafe) + return ActorIsolation::forConcurrent(parentIsolation.isUnsafe()) .withPreconcurrency(preconcurrency); case ActorIsolation::Erased: @@ -4542,10 +4541,10 @@ namespace { return parentIsolation; } - return ActorIsolation::forNonisolated(/*unsafe=*/false) + return ActorIsolation::forConcurrent(/*unsafe=*/false) .withPreconcurrency(preconcurrency); } - } + } } }; @@ -4707,7 +4706,7 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true, (globalActorAttr ? 1 : 0) + (concurrentExecutionAttr ? 1 : 0); if (numIsolationAttrs == 0) { if (isa(decl) && !decl->isImplicit()) { - return ActorIsolation::forNonisolated(false); + return ActorIsolation::forConcurrent(false); } return std::nullopt; } @@ -4722,11 +4721,13 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true, if (auto *func = dyn_cast(decl); func && func->hasAsync() && func->getModuleContext() == decl->getASTContext().MainModule) { - return ActorIsolation::forCallerIsolationInheriting(); + return ActorIsolation::forNonisolated(false /*unsafe*/); } } - return ActorIsolation::forNonisolated(nonisolatedAttr->isUnsafe()); + ActorIsolation result = + ActorIsolation::forConcurrent(nonisolatedAttr->isUnsafe()); + return result; } // If the declaration is explicitly marked 'isolated', infer actor isolation @@ -4821,9 +4822,9 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true, if (concurrentExecutionAttr) { switch (concurrentExecutionAttr->getBehavior()) { case ExecutionKind::Concurrent: - return ActorIsolation::forNonisolated(false /*is unsafe*/); + return ActorIsolation::forConcurrent(false /*is unsafe*/); case ExecutionKind::Caller: - return ActorIsolation::forCallerIsolationInheriting(); + return ActorIsolation::forNonisolated(false /*is unsafe*/); } } @@ -4874,8 +4875,9 @@ getIsolationFromWitnessedRequirements(ValueDecl *value) { case ActorIsolation::GlobalActor: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; } @@ -4899,9 +4901,10 @@ getIsolationFromWitnessedRequirements(ValueDecl *value) { case ActorIsolation::ActorInstance: llvm_unreachable("protocol requirements cannot be actor instances"); - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: // We only need one nonisolated. if (sawActorIndependent) return true; @@ -4978,8 +4981,9 @@ getIsolationFromConformances(NominalTypeDecl *nominal) { case ActorIsolation::ActorInstance: case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: @@ -5015,8 +5019,9 @@ getIsolationFromInheritedProtocols(ProtocolDecl *protocol) { case ActorIsolation::ActorInstance: case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return; case ActorIsolation::Erased: @@ -5090,8 +5095,9 @@ getIsolationFromWrappers(NominalTypeDecl *nominal) { case ActorIsolation::ActorInstance: case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: @@ -5289,10 +5295,10 @@ static bool checkClassGlobalActorIsolation( switch (superIsolation) { case ActorIsolation::Unspecified: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: - case ActorIsolation::NonisolatedUnsafe: { + case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: return false; - } case ActorIsolation::Erased: llvm_unreachable("class cannot have erased isolation"); @@ -5492,13 +5498,13 @@ static void addAttributesForActorIsolation(ValueDecl *value, ActorIsolation isolation) { ASTContext &ctx = value->getASTContext(); switch (isolation) { - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::Nonisolated: - case ActorIsolation::NonisolatedUnsafe: { - value->getAttrs().add(new (ctx) NonisolatedAttr( - isolation == ActorIsolation::NonisolatedUnsafe, /*implicit=*/true)); + case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: + value->getAttrs().add( + new (ctx) NonisolatedAttr(isolation.isUnsafe(), /*implicit=*/true)); break; - } case ActorIsolation::GlobalActor: { auto typeExpr = TypeExpr::createImplicit(isolation.getGlobalActor(), ctx); auto attr = @@ -5640,14 +5646,14 @@ InferredActorIsolation ActorIsolationRequest::evaluate( if (auto *func = dyn_cast(value); func && func->hasAsync() && func->getModuleContext() == ctx.MainModule) { - defaultIsolation = ActorIsolation::forCallerIsolationInheriting(); + defaultIsolation = ActorIsolation::forNonisolated(false /*is unsafe*/); } } if (auto func = dyn_cast(value)) { // A @Sendable function is assumed to be actor-independent. if (func->isSendable()) { - defaultIsolation = ActorIsolation::forNonisolated(/*unsafe=*/false); + defaultIsolation = ActorIsolation::forConcurrent(/*unsafe=*/false); } } @@ -5656,7 +5662,7 @@ InferredActorIsolation ActorIsolationRequest::evaluate( if (nominal->isAnyActor()) if (auto ctor = dyn_cast(value)) if (!ctor->hasAsync()) - defaultIsolation = ActorIsolation::forNonisolated(/*unsafe=*/false); + defaultIsolation = ActorIsolation::forConcurrent(/*unsafe=*/false); // Look for and remember the overridden declaration's isolation. std::optional overriddenIso; @@ -5701,6 +5707,8 @@ InferredActorIsolation ActorIsolationRequest::evaluate( switch (inferred) { case ActorIsolation::Nonisolated: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: // Stored properties cannot be non-isolated, so don't infer it. if (auto var = dyn_cast(value)) { if (!var->isStatic() && var->hasStorage()) @@ -5716,8 +5724,6 @@ InferredActorIsolation ActorIsolationRequest::evaluate( // Add nonisolated attribute addAttributesForActorIsolation(value, inferred); break; - case ActorIsolation::CallerIsolationInheriting: - break; case ActorIsolation::Erased: llvm_unreachable("cannot infer erased isolation"); case ActorIsolation::GlobalActor: { @@ -5753,8 +5759,9 @@ InferredActorIsolation ActorIsolationRequest::evaluate( switch (auto enclosingIsolation = getActorIsolationOfContext(dc)) { case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: // Do nothing. break; @@ -5924,8 +5931,8 @@ InferredActorIsolation ActorIsolationRequest::evaluate( Feature::NonIsolatedAsyncInheritsIsolationFromContext) && func && func->hasAsync() && func->getModuleContext() == ctx.MainModule && - isolation.isNonisolated()) { - isolation = ActorIsolation::forCallerIsolationInheriting(); + isolation.isConcurrent()) { + isolation = ActorIsolation::forNonisolated(false /*is unsafe*/); } return {inferredIsolation(isolation, onlyGlobal), @@ -6011,8 +6018,9 @@ bool HasIsolatedSelfRequest::evaluate( if (auto var = dyn_cast(value)) { switch (auto isolation = getActorIsolationFromWrappedProperty(var)) { case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: break; @@ -6159,8 +6167,7 @@ void swift::checkGlobalIsolation(VarDecl *var) { const auto isolation = getActorIsolation(var); if (var->getLoc() && var->getASTContext().LangOpts.hasFeature(Feature::GlobalConcurrency) && - !isolation.isGlobalActor() && - (isolation != ActorIsolation::NonisolatedUnsafe)) { + !isolation.isGlobalActor() && !isolation.isUnsafe()) { auto *classDecl = var->getDeclContext()->getSelfClassDecl(); const bool isActorType = classDecl && classDecl->isAnyActor(); if (var->isGlobalStorage() && !isActorType) { @@ -6346,7 +6353,7 @@ static bool checkSendableInstanceStorage( // 'nonisolated' properties are always okay in 'Sendable' types because // they can be accessed from anywhere. Note that 'nonisolated' without // '(unsafe)' can only be applied to immutable, 'Sendable' properties. - if (isolation.isNonisolated()) + if (isolation.isConcurrent()) return false; // Classes with mutable properties are Sendable if property is @@ -6365,7 +6372,7 @@ static bool checkSendableInstanceStorage( return true; } - if (!(isolation.isNonisolated() || isolation.isUnspecified())) { + if (!(isolation.isConcurrent() || isolation.isUnspecified())) { return false; // skip sendable check on actor-isolated properties } } @@ -6536,8 +6543,9 @@ bool swift::checkSendableConformance( case ActorIsolation::Unspecified: case ActorIsolation::ActorInstance: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: break; case ActorIsolation::Erased: @@ -7048,8 +7056,9 @@ AnyFunctionType *swift::adjustFunctionTypeForConcurrency( return fnType; case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: assert(fnType->getIsolation().isNonIsolated()); return fnType; @@ -7241,10 +7250,9 @@ ActorIsolation swift::getActorIsolationForReference(ValueDecl *decl, ActorReferenceResult::Options options = std::nullopt; if (varIsSafeAcrossActors(fromModule, var, declIsolation, std::nullopt, options) && var->getTypeInContext()->isSendableType()) - return ActorIsolation::forNonisolated(/*unsafe*/false); + return ActorIsolation::forConcurrent(/*unsafe*/ false); - if (var->isLet() && isStoredProperty(var) && - declIsolation.isNonisolated()) { + if (var->isLet() && isStoredProperty(var) && declIsolation.isConcurrent()) { if (auto nominal = var->getDeclContext()->getSelfNominalTypeDecl()) { if (nominal->isAnyActor()) return ActorIsolation::forActorInstanceSelf(decl); @@ -7330,8 +7338,9 @@ bool swift::isAccessibleAcrossActors( switch (isolation) { case ActorIsolation::ActorInstance: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: return true; diff --git a/lib/Sema/TypeCheckDeclObjC.cpp b/lib/Sema/TypeCheckDeclObjC.cpp index 5a99ea6b2f585..32f71ec8846c7 100644 --- a/lib/Sema/TypeCheckDeclObjC.cpp +++ b/lib/Sema/TypeCheckDeclObjC.cpp @@ -505,8 +505,9 @@ static bool checkObjCActorIsolation(const ValueDecl *VD, ObjCReason Reason) { llvm_unreachable("decl cannot have dynamic isolation"); case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: return false; } diff --git a/lib/Sema/TypeCheckPropertyWrapper.cpp b/lib/Sema/TypeCheckPropertyWrapper.cpp index 849ab5e26f27d..5c66d4dbfb00d 100644 --- a/lib/Sema/TypeCheckPropertyWrapper.cpp +++ b/lib/Sema/TypeCheckPropertyWrapper.cpp @@ -101,8 +101,9 @@ static VarDecl *findValueProperty(ASTContext &ctx, NominalTypeDecl *nominal, case ActorIsolation::GlobalActor: case ActorIsolation::Nonisolated: - case ActorIsolation::CallerIsolationInheriting: case ActorIsolation::NonisolatedUnsafe: + case ActorIsolation::Concurrent: + case ActorIsolation::ConcurrentUnsafe: case ActorIsolation::Unspecified: break; } diff --git a/lib/Sema/TypeCheckUnsafe.cpp b/lib/Sema/TypeCheckUnsafe.cpp index f8bcd8f5491c3..3deebc23b1870 100644 --- a/lib/Sema/TypeCheckUnsafe.cpp +++ b/lib/Sema/TypeCheckUnsafe.cpp @@ -164,7 +164,7 @@ void swift::diagnoseUnsafeUse(const UnsafeUse &use) { static bool isReferenceToNonisolatedUnsafe(ValueDecl *decl) { auto isolation = getActorIsolationForReference( decl, decl->getDeclContext()); - if (!isolation.isNonisolated()) + if (!isolation.isConcurrent()) return false; auto attr = decl->getAttrs().getAttribute(); diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 1489b7a47c0b4..a77ccae322a01 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -492,8 +492,9 @@ getActualActorIsolationKind(uint8_t raw) { CASE(Unspecified) CASE(ActorInstance) CASE(Nonisolated) - CASE(CallerIsolationInheriting) CASE(NonisolatedUnsafe) + CASE(Concurrent) + CASE(ConcurrentUnsafe) CASE(GlobalActor) CASE(Erased) #undef CASE @@ -4071,13 +4072,19 @@ class DeclDeserializer { ActorIsolation isolation; switch (isoKind) { case ActorIsolation::Unspecified: - case ActorIsolation::Nonisolated: - case ActorIsolation::NonisolatedUnsafe: isolation = ActorIsolation::forUnspecified(); break; - - case ActorIsolation::CallerIsolationInheriting: - isolation = ActorIsolation::forCallerIsolationInheriting(); + case ActorIsolation::Concurrent: + isolation = ActorIsolation::forConcurrent(false); + break; + case ActorIsolation::ConcurrentUnsafe: + isolation = ActorIsolation::forConcurrent(true); + break; + case ActorIsolation::Nonisolated: + isolation = ActorIsolation::forNonisolated(false); + break; + case ActorIsolation::NonisolatedUnsafe: + isolation = ActorIsolation::forNonisolated(true); break; case ActorIsolation::Erased: diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index 6fdf00998bed7..079ffc5c930e4 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 917; // ossa serialization +const uint16_t SWIFTMODULE_VERSION_MINOR = 918; // concurrent /// A standard hash seed used for all string hashes in a serialized module. /// @@ -564,7 +564,8 @@ enum class ActorIsolation : uint8_t { GlobalActor, GlobalActorUnsafe, Erased, - CallerIsolationInheriting, + Concurrent, + ConcurrentUnsafe, }; using ActorIsolationField = BCFixed<3>; diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index bfcf10f4078ef..de32b6bd65fed 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -1551,8 +1551,9 @@ getRawStableActorIsolationKind(swift::ActorIsolation::Kind kind) { CASE(Unspecified) CASE(ActorInstance) CASE(Nonisolated) - CASE(CallerIsolationInheriting) CASE(NonisolatedUnsafe) + CASE(Concurrent) + CASE(ConcurrentUnsafe) CASE(GlobalActor) CASE(Erased) #undef CASE diff --git a/test/Concurrency/assume_mainactor.swift b/test/Concurrency/assume_mainactor.swift index 4064bb7582de8..237783626be02 100644 --- a/test/Concurrency/assume_mainactor.swift +++ b/test/Concurrency/assume_mainactor.swift @@ -15,17 +15,17 @@ class Klass { // Implicit deallocating deinit // CHECK: // Klass.__deallocating_deinit - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor5KlassCfD : $@convention(method) (@owned Klass) -> () { // Implicit allocating init // CHECK: // Klass.__allocating_init() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [exact_self_class] [ossa] @$s16assume_mainactor5KlassCACycfC : $@convention(method) (@thick Klass.Type) -> @owned Klass { // Implicit designated init // CHECK: // Klass.init() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor5KlassCACycfc : $@convention(method) (@owned Klass) -> @owned Klass { } @@ -44,7 +44,7 @@ struct StructContainingKlass { var k = Klass() // CHECK: // StructContainingKlass.init() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor21StructContainingKlassVACycfC : $@convention(method) (@thin StructContainingKlass.Type) -> @owned StructContainingKlass { } @@ -64,7 +64,7 @@ struct NonIsolatedStructContainingKlass { var k = Klass() // CHECK: // NonIsolatedStructContainingKlass.init() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor32NonIsolatedStructContainingKlassVACycfC : $@convention(method) (@thin NonIsolatedStructContainingKlass.Type) -> @owned NonIsolatedStructContainingKlass { } @@ -79,7 +79,7 @@ actor CustomActor { func unspecifiedAsync(_ t: T) async {} // CHECK: // nonisolatedAsync(_:) -// CHECK-NEXT: // Isolation: nonisolated +// CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor16nonisolatedAsyncyyxYalF : $@convention(thin) @async (@in_guaranteed T) -> () { nonisolated func nonisolatedAsync(_ t: T) async {} @@ -152,7 +152,7 @@ func unspecifiedFunctionTest3() async { } // CHECK: // nonisolatedFunctionTest() -// CHECK-NEXT: // Isolation: nonisolated +// CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor23nonisolatedFunctionTestyyYaF : $@convention(thin) @async () -> () { nonisolated func nonisolatedFunctionTest() async { let k = NonIsolatedStructContainingKlass() @@ -194,7 +194,7 @@ actor MyActor { // Non-async init should be nonisolated // CHECK: // MyActor.init() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s16assume_mainactor7MyActorCACycfc : $@convention(method) (@owned MyActor) -> @owned MyActor { } diff --git a/test/Concurrency/attr_execution.swift b/test/Concurrency/attr_execution.swift index dc6e198b66f61..5f4eb6cfb129a 100644 --- a/test/Concurrency/attr_execution.swift +++ b/test/Concurrency/attr_execution.swift @@ -5,13 +5,13 @@ // CHECK-LABEL: // concurrentTest() -// CHECK: // Isolation: nonisolated +// CHECK: // Isolation: concurrent // CHECK: sil hidden [ossa] @$s14attr_execution14concurrentTestyyYaF : $@convention(thin) @async () -> () { @execution(concurrent) func concurrentTest() async {} // CHECK-LABEL: // callerTest() -// CHECK: // Isolation: caller_isolation_inheriting +// CHECK: // Isolation: nonisolated // CHECK: sil hidden [ossa] @$s14attr_execution10callerTestyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { @execution(caller) func callerTest() async {} diff --git a/test/Concurrency/deinit_isolation.swift b/test/Concurrency/deinit_isolation.swift index 42686c5203ac2..e2be1086137cd 100644 --- a/test/Concurrency/deinit_isolation.swift +++ b/test/Concurrency/deinit_isolation.swift @@ -27,7 +27,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: BaseWithNonisolatedDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation25BaseWithNonisolatedDeinitCfZ // CHECK-SYMB: // BaseWithNonisolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation25BaseWithNonisolatedDeinitCfD : $@convention(method) (@owned BaseWithNonisolatedDeinit) -> () { class BaseWithNonisolatedDeinit {} @@ -38,7 +38,7 @@ class BaseWithNonisolatedDeinit {} // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation34BaseWithDeinitIsolatedOnFirstActorCfZ : $@convention(thin) (@owned BaseWithDeinitIsolatedOnFirstActor) -> () { // CHECK-SYMB: BaseWithDeinitIsolatedOnFirstActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation34BaseWithDeinitIsolatedOnFirstActorCfD : $@convention(method) (@owned BaseWithDeinitIsolatedOnFirstActor) -> () { class BaseWithDeinitIsolatedOnFirstActor { @FirstActor deinit {} // expected-note 3{{overridden declaration is here}} @@ -57,7 +57,7 @@ class BaseIsolatedOnSecondActor {} // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation35BaseWithDeinitIsolatedOnSecondActorCfZ : $@convention(thin) (@owned BaseWithDeinitIsolatedOnSecondActor) -> () { // CHECK-SYMB: BaseWithDeinitIsolatedOnSecondActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation35BaseWithDeinitIsolatedOnSecondActorCfD : $@convention(method) (@owned BaseWithDeinitIsolatedOnSecondActor) -> () { class BaseWithDeinitIsolatedOnSecondActor { @SecondActor deinit {} // expected-note 3{{overridden declaration is here}} @@ -71,7 +71,7 @@ class BaseWithDeinitIsolatedOnSecondActor { // CHECK-SYMB-NOT: ImplicitDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation19ImplicitDeinitActorCfZ // CHECK-SYMB: // ImplicitDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation19ImplicitDeinitActorCfD : $@convention(method) (@owned ImplicitDeinitActor) -> () { actor ImplicitDeinitActor { // nonisolated deinit @@ -83,7 +83,7 @@ actor ImplicitDeinitActor { // CHECK-SYMB-NOT: DefaultDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation18DefaultDeinitActorCfZ // CHECK-SYMB: // DefaultDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation18DefaultDeinitActorCfD : $@convention(method) (@owned DefaultDeinitActor) -> () { actor DefaultDeinitActor { // self-isolated deinit @@ -101,7 +101,7 @@ actor DefaultDeinitActor { // CHECK-SYMB-NEXT: // Isolation: actor_instance. name: 'self' // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation21PropagatedDeinitActorCfZ : $@convention(thin) (@owned PropagatedDeinitActor) -> () { // CHECK-SYMB: // PropagatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation21PropagatedDeinitActorCfD : $@convention(method) (@owned PropagatedDeinitActor) -> () { actor PropagatedDeinitActor { // self-isolated deinit @@ -118,7 +118,7 @@ actor PropagatedDeinitActor { // CHECK-SYMB-NOT: NonisolatedDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation22NonisolatedDeinitActorCfZ // CHECK-SYMB: // NonisolatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation22NonisolatedDeinitActorCfD : $@convention(method) (@owned NonisolatedDeinitActor) -> () { actor NonisolatedDeinitActor { // nonisolated deinit @@ -136,7 +136,7 @@ actor NonisolatedDeinitActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation19IsolatedDeinitActorCfZ : $@convention(thin) (@owned IsolatedDeinitActor) -> () { // CHECK-SYMB: // IsolatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation19IsolatedDeinitActorCfD : $@convention(method) (@owned IsolatedDeinitActor) -> () { actor IsolatedDeinitActor { // FirstActor-isolated deinit @@ -154,7 +154,7 @@ actor IsolatedDeinitActor { // CHECK-SYMB-NOT: ImplicitDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation14ImplicitDeinitCfZ // CHECK-SYMB: // ImplicitDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation14ImplicitDeinitCfD : $@convention(method) (@owned ImplicitDeinit) -> () { @FirstActor class ImplicitDeinit { @@ -167,7 +167,7 @@ class ImplicitDeinit { // CHECK-SYMB-NOT: DefaultDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation13DefaultDeinitCfZ // CHECK-SYMB: // DefaultDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation13DefaultDeinitCfD : $@convention(method) (@owned DefaultDeinit) -> () { @FirstActor class DefaultDeinit { @@ -185,7 +185,7 @@ class DefaultDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation16PropagatedDeinitCfZ : $@convention(thin) (@owned PropagatedDeinit) -> () { // CHECK-SYMB: // PropagatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation16PropagatedDeinitCfD : $@convention(method) (@owned PropagatedDeinit) -> () { @FirstActor class PropagatedDeinit { @@ -207,7 +207,7 @@ class BadPropagatedDeinit { // CHECK-SYMB-NOT: NonisolatedDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation17NonisolatedDeinitCfZ // CHECK-SYMB: // NonisolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation17NonisolatedDeinitCfD : $@convention(method) (@owned NonisolatedDeinit) -> () { @FirstActor class NonisolatedDeinit { @@ -226,7 +226,7 @@ class NonisolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation14IsolatedDeinitCfZ : $@convention(thin) (@owned IsolatedDeinit) -> () { // CHECK-SYMB: // IsolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation14IsolatedDeinitCfD : $@convention(method) (@owned IsolatedDeinit) -> () { class IsolatedDeinit { // FirstActor-isolated deinit @@ -242,7 +242,7 @@ class IsolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation23DifferentIsolatedDeinitCfZ : $@convention(thin) (@owned DifferentIsolatedDeinit) -> () { // CHECK-SYMB: // DifferentIsolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation23DifferentIsolatedDeinitCfD : $@convention(method) (@owned DifferentIsolatedDeinit) -> () { @FirstActor class DifferentIsolatedDeinit { @@ -262,7 +262,7 @@ class DifferentIsolatedDeinit { // CHECK-SYMB-NOT: ImplicitDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation32ImplicitDeinitInheritNonisolatedCfZ // CHECK-SYMB: // ImplicitDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation32ImplicitDeinitInheritNonisolatedCfD : $@convention(method) (@owned ImplicitDeinitInheritNonisolated) -> () { @FirstActor class ImplicitDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -275,7 +275,7 @@ class ImplicitDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NOT: // DefaultDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: sil hidden [ossa] @$s16deinit_isolation31DefaultDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned DefaultDeinitInheritNonisolated) -> () { // CHECK-SYMB: // DefaultDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation31DefaultDeinitInheritNonisolatedCfD : $@convention(method) (@owned DefaultDeinitInheritNonisolated) -> () { @FirstActor class DefaultDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -300,7 +300,7 @@ class BadPropagatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation34PropagatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned PropagatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // PropagatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation34PropagatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned PropagatedDeinitInheritNonisolated) -> () { @FirstActor class PropagatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -316,7 +316,7 @@ class PropagatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NOT: NonisolatedDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s16deinit_isolation024NonisolatedDeinitInheritC0CfZ // CHECK-SYMB: // NonisolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation024NonisolatedDeinitInheritC0CfD : $@convention(method) (@owned NonisolatedDeinitInheritNonisolated) -> () { @FirstActor class NonisolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -335,7 +335,7 @@ class NonisolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation32IsolatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned IsolatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // IsolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation32IsolatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned IsolatedDeinitInheritNonisolated) -> () { class IsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // FirstActor-isolated deinit @@ -351,7 +351,7 @@ class IsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation41DifferentIsolatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned DifferentIsolatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // DifferentIsolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation41DifferentIsolatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned DifferentIsolatedDeinitInheritNonisolated) -> () { @FirstActor class DifferentIsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -372,7 +372,7 @@ class DifferentIsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation30ImplicitDeinitInheritIsolated1CfZ : $@convention(thin) (@owned ImplicitDeinitInheritIsolated1) -> () { // CHECK-SYMB: // ImplicitDeinitInheritIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation30ImplicitDeinitInheritIsolated1CfD : $@convention(method) (@owned ImplicitDeinitInheritIsolated1) -> () { @FirstActor class ImplicitDeinitInheritIsolated1: BaseWithDeinitIsolatedOnFirstActor { @@ -404,7 +404,7 @@ class BadPropagatedDeinitIsolated: BaseWithDeinitIsolatedOnFirstActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation29GoodPropagatedDeinitIsolated1CfZ : $@convention(thin) (@owned GoodPropagatedDeinitIsolated1) -> () { // CHECK-SYMB: // GoodPropagatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation29GoodPropagatedDeinitIsolated1CfD : $@convention(method) (@owned GoodPropagatedDeinitIsolated1) -> () { class GoodPropagatedDeinitIsolated1: BaseIsolatedOnFirstActor { isolated deinit { @@ -419,7 +419,7 @@ class GoodPropagatedDeinitIsolated1: BaseIsolatedOnFirstActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation25PropagatedDeinitIsolated1CfZ : $@convention(thin) (@owned PropagatedDeinitIsolated1) -> () { // CHECK-SYMB: // PropagatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation25PropagatedDeinitIsolated1CfD : $@convention(method) (@owned PropagatedDeinitIsolated1) -> () { @FirstActor class PropagatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { @@ -446,7 +446,7 @@ class NonisolatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation23IsolatedDeinitIsolated1CfZ : $@convention(thin) (@owned IsolatedDeinitIsolated1) -> () { // CHECK-SYMB: // IsolatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation23IsolatedDeinitIsolated1CfD : $@convention(method) (@owned IsolatedDeinitIsolated1) -> () { class IsolatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { // FirstActor-isolated deinit @@ -474,7 +474,7 @@ class DifferentIsolatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation30ImplicitDeinitInheritIsolated2CfZ : $@convention(thin) (@owned ImplicitDeinitInheritIsolated2) -> () { // CHECK-SYMB: // ImplicitDeinitInheritIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation30ImplicitDeinitInheritIsolated2CfD : $@convention(method) (@owned ImplicitDeinitInheritIsolated2) -> () { @FirstActor class ImplicitDeinitInheritIsolated2: BaseWithDeinitIsolatedOnSecondActor { @@ -488,7 +488,7 @@ class ImplicitDeinitInheritIsolated2: BaseWithDeinitIsolatedOnSecondActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation29GoodPropagatedDeinitIsolated2CfZ : $@convention(thin) (@owned GoodPropagatedDeinitIsolated2) -> () { // CHECK-SYMB: // GoodPropagatedDeinitIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation29GoodPropagatedDeinitIsolated2CfD : $@convention(method) (@owned GoodPropagatedDeinitIsolated2) -> () { class GoodPropagatedDeinitIsolated2: BaseIsolatedOnSecondActor { isolated deinit { @@ -534,7 +534,7 @@ class IsolatedDeinitIsolated2: BaseWithDeinitIsolatedOnSecondActor { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation32DifferentIsolatedDeinitIsolated2CfZ : $@convention(thin) (@owned DifferentIsolatedDeinitIsolated2) -> () { // CHECK-SYMB: // DifferentIsolatedDeinitIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s16deinit_isolation32DifferentIsolatedDeinitIsolated2CfD : $@convention(method) (@owned DifferentIsolatedDeinitIsolated2) -> () { @FirstActor class DifferentIsolatedDeinitIsolated2: BaseWithDeinitIsolatedOnSecondActor { diff --git a/test/Concurrency/deinit_isolation_import/test.swift b/test/Concurrency/deinit_isolation_import/test.swift index f9894402df2ec..5385d1841c8cb 100644 --- a/test/Concurrency/deinit_isolation_import/test.swift +++ b/test/Concurrency/deinit_isolation_import/test.swift @@ -35,7 +35,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedFu // CHECK-SYMB-NOT: ProbeImplicit_RoundtripNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test34ProbeImplicit_RoundtripNonisolatedCfZ // CHECK-SYMB: // ProbeImplicit_RoundtripNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test34ProbeImplicit_RoundtripNonisolatedCfD : $@convention(method) (@owned ProbeImplicit_RoundtripNonisolated) -> () { class ProbeImplicit_RoundtripNonisolated: RoundtripNonisolated {} @@ -45,7 +45,7 @@ class ProbeImplicit_RoundtripNonisolated: RoundtripNonisolated {} // CHECK-SYMB-NOT: ProbeDefault_RoundtripNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test33ProbeDefault_RoundtripNonisolatedCfZ // CHECK-SYMB: // ProbeDefault_RoundtripNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test33ProbeDefault_RoundtripNonisolatedCfD : $@convention(method) (@owned ProbeDefault_RoundtripNonisolated) -> () { class ProbeDefault_RoundtripNonisolated: RoundtripNonisolated { deinit { @@ -70,7 +70,7 @@ class ProbeIsolated_RoundtripNonisolated: RoundtripNonisolated { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: AnotherActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test32ProbeGlobal_RoundtripNonisolatedCfZ : $@convention(thin) (@owned ProbeGlobal_RoundtripNonisolated) -> () { // CHECK-SYMB: // ProbeGlobal_RoundtripNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test32ProbeGlobal_RoundtripNonisolatedCfD : $@convention(method) (@owned ProbeGlobal_RoundtripNonisolated) -> () { class ProbeGlobal_RoundtripNonisolated: RoundtripNonisolated { @AnotherActor deinit { @@ -90,7 +90,7 @@ class ProbeGlobal_RoundtripNonisolated: RoundtripNonisolated { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test31ProbeImplicit_RoundtripIsolatedCfZ : $@convention(thin) (@owned ProbeImplicit_RoundtripIsolated) -> () { // CHECK-SYMB: // ProbeImplicit_RoundtripIsolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test31ProbeImplicit_RoundtripIsolatedCfD : $@convention(method) (@owned ProbeImplicit_RoundtripIsolated) -> () { class ProbeImplicit_RoundtripIsolated: RoundtripIsolated {} @@ -115,7 +115,7 @@ class ProbeIsolated_RoundtripIsolated: RoundtripIsolated { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test29ProbeGlobal_RoundtripIsolatedCfZ : $@convention(thin) (@owned ProbeGlobal_RoundtripIsolated) -> () { // CHECK-SYMB: // ProbeGlobal_RoundtripIsolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test29ProbeGlobal_RoundtripIsolatedCfD : $@convention(method) (@owned ProbeGlobal_RoundtripIsolated) -> () { class ProbeGlobal_RoundtripIsolated: RoundtripIsolated { #if !SILGEN @@ -133,7 +133,7 @@ class ProbeGlobal_RoundtripIsolated: RoundtripIsolated { // CHECK-SYMB-NOT: ProbeImplicit_BaseNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test29ProbeImplicit_BaseNonisolatedCfZ // CHECK-SYMB: // ProbeImplicit_BaseNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test29ProbeImplicit_BaseNonisolatedCfD : $@convention(method) (@owned ProbeImplicit_BaseNonisolated) -> () { class ProbeImplicit_BaseNonisolated: BaseNonisolated {} @@ -143,7 +143,7 @@ class ProbeImplicit_BaseNonisolated: BaseNonisolated {} // CHECK-SYMB-NOT: ProbeDefault_BaseNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test28ProbeDefault_BaseNonisolatedCfZ // CHECK-SYMB: // ProbeDefault_BaseNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test28ProbeDefault_BaseNonisolatedCfD : $@convention(method) (@owned ProbeDefault_BaseNonisolated) -> () { class ProbeDefault_BaseNonisolated: BaseNonisolated { deinit { @@ -168,7 +168,7 @@ class ProbeIsolated_BaseNonisolated: BaseNonisolated { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: AnotherActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test27ProbeGlobal_BaseNonisolatedCfZ : $@convention(thin) (@owned ProbeGlobal_BaseNonisolated) -> () { // CHECK-SYMB: // ProbeGlobal_BaseNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test27ProbeGlobal_BaseNonisolatedCfD : $@convention(method) (@owned ProbeGlobal_BaseNonisolated) -> () { class ProbeGlobal_BaseNonisolated: BaseNonisolated { @AnotherActor deinit { @@ -186,7 +186,7 @@ class ProbeGlobal_BaseNonisolated: BaseNonisolated { // CHECK-SYMB-NOT: ProbeImplicit_DerivedNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test32ProbeImplicit_DerivedNonisolatedCfZ // CHECK-SYMB: // ProbeImplicit_DerivedNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test32ProbeImplicit_DerivedNonisolatedCfD : $@convention(method) (@owned ProbeImplicit_DerivedNonisolated) -> () { class ProbeImplicit_DerivedNonisolated: DerivedNonisolated {} @@ -196,7 +196,7 @@ class ProbeImplicit_DerivedNonisolated: DerivedNonisolated {} // CHECK-SYMB-NOT: ProbeDefault_DerivedNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test31ProbeDefault_DerivedNonisolatedCfZ // CHECK-SYMB: // ProbeDefault_DerivedNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test31ProbeDefault_DerivedNonisolatedCfD : $@convention(method) (@owned ProbeDefault_DerivedNonisolated) -> () { class ProbeDefault_DerivedNonisolated: DerivedNonisolated { deinit { @@ -221,7 +221,7 @@ class ProbeIsolated_DerivedNonisolated: DerivedNonisolated { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: AnotherActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test30ProbeGlobal_DerivedNonisolatedCfZ : $@convention(thin) (@owned ProbeGlobal_DerivedNonisolated) -> () { // CHECK-SYMB: // ProbeGlobal_DerivedNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test30ProbeGlobal_DerivedNonisolatedCfD : $@convention(method) (@owned ProbeGlobal_DerivedNonisolated) -> () { class ProbeGlobal_DerivedNonisolated: DerivedNonisolated { @AnotherActor deinit { @@ -239,7 +239,7 @@ class ProbeGlobal_DerivedNonisolated: DerivedNonisolated { // CHECK-SYMB-NOT: ProbeImplicit_BaseIsolatedClass.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test31ProbeImplicit_BaseIsolatedClassCfZ // CHECK-SYMB: // ProbeImplicit_BaseIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test31ProbeImplicit_BaseIsolatedClassCfD : $@convention(method) (@owned ProbeImplicit_BaseIsolatedClass) -> () { class ProbeImplicit_BaseIsolatedClass: BaseIsolatedClass {} @@ -249,7 +249,7 @@ class ProbeImplicit_BaseIsolatedClass: BaseIsolatedClass {} // CHECK-SYMB-NOT: ProbeDefault_BaseIsolatedClass.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test30ProbeDefault_BaseIsolatedClassCfZ // CHECK-SYMB: // ProbeDefault_BaseIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test30ProbeDefault_BaseIsolatedClassCfD : $@convention(method) (@owned ProbeDefault_BaseIsolatedClass) -> () { class ProbeDefault_BaseIsolatedClass: BaseIsolatedClass { deinit { @@ -266,7 +266,7 @@ class ProbeDefault_BaseIsolatedClass: BaseIsolatedClass { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test018ProbeIsolated_BaseC5ClassCfZ : $@convention(thin) (@owned ProbeIsolated_BaseIsolatedClass) -> () { // CHECK-SYMB: // ProbeIsolated_BaseIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test018ProbeIsolated_BaseC5ClassCfD : $@convention(method) (@owned ProbeIsolated_BaseIsolatedClass) -> () { class ProbeIsolated_BaseIsolatedClass: BaseIsolatedClass { isolated deinit { @@ -281,7 +281,7 @@ class ProbeIsolated_BaseIsolatedClass: BaseIsolatedClass { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: AnotherActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test29ProbeGlobal_BaseIsolatedClassCfZ : $@convention(thin) (@owned ProbeGlobal_BaseIsolatedClass) -> () { // CHECK-SYMB: // ProbeGlobal_BaseIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test29ProbeGlobal_BaseIsolatedClassCfD : $@convention(method) (@owned ProbeGlobal_BaseIsolatedClass) -> () { class ProbeGlobal_BaseIsolatedClass: BaseIsolatedClass { @AnotherActor deinit { @@ -299,7 +299,7 @@ class ProbeGlobal_BaseIsolatedClass: BaseIsolatedClass { // CHECK-SYMB-NOT: ProbeImplicit_DerivedIsolatedClass.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test34ProbeImplicit_DerivedIsolatedClassCfZ // CHECK-SYMB: // ProbeImplicit_DerivedIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test34ProbeImplicit_DerivedIsolatedClassCfD : $@convention(method) (@owned ProbeImplicit_DerivedIsolatedClass) -> () { class ProbeImplicit_DerivedIsolatedClass: DerivedIsolatedClass {} @@ -309,7 +309,7 @@ class ProbeImplicit_DerivedIsolatedClass: DerivedIsolatedClass {} // CHECK-SYMB-NOT: ProbeDefault_DerivedIsolatedClass.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test33ProbeDefault_DerivedIsolatedClassCfZ // CHECK-SYMB: // ProbeDefault_DerivedIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test33ProbeDefault_DerivedIsolatedClassCfD : $@convention(method) (@owned ProbeDefault_DerivedIsolatedClass) -> () { class ProbeDefault_DerivedIsolatedClass: DerivedIsolatedClass { deinit { @@ -326,7 +326,7 @@ class ProbeDefault_DerivedIsolatedClass: DerivedIsolatedClass { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test021ProbeIsolated_DerivedC5ClassCfZ : $@convention(thin) (@owned ProbeIsolated_DerivedIsolatedClass) -> () { // CHECK-SYMB: // ProbeIsolated_DerivedIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test021ProbeIsolated_DerivedC5ClassCfD : $@convention(method) (@owned ProbeIsolated_DerivedIsolatedClass) -> () { class ProbeIsolated_DerivedIsolatedClass: DerivedIsolatedClass { isolated deinit { @@ -341,7 +341,7 @@ class ProbeIsolated_DerivedIsolatedClass: DerivedIsolatedClass { // CHECK-SYMB-NEXT: // Isolation: global_actor. type: AnotherActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test32ProbeGlobal_DerivedIsolatedClassCfZ : $@convention(thin) (@owned ProbeGlobal_DerivedIsolatedClass) -> () { // CHECK-SYMB: // ProbeGlobal_DerivedIsolatedClass.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test32ProbeGlobal_DerivedIsolatedClassCfD : $@convention(method) (@owned ProbeGlobal_DerivedIsolatedClass) -> () { class ProbeGlobal_DerivedIsolatedClass: DerivedIsolatedClass { @AnotherActor deinit { @@ -363,7 +363,7 @@ class ProbeGlobal_DerivedIsolatedClass: DerivedIsolatedClass { // CHECK-SYMB-NOT: ProbeImplicit_BaseIsolatedDealloc.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test33ProbeImplicit_BaseIsolatedDeallocCfZ // CHECK-SYMB: // ProbeImplicit_BaseIsolatedDealloc.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test33ProbeImplicit_BaseIsolatedDeallocCfD : $@convention(method) (@owned ProbeImplicit_BaseIsolatedDealloc) -> () { class ProbeImplicit_BaseIsolatedDealloc: BaseIsolatedDealloc {} @@ -389,7 +389,7 @@ class ProbeIsolated_BaseIsolatedDealloc: BaseIsolatedDealloc { // CHECK-SYMB-NOT: ProbeGlobal_BaseIsolatedDealloc.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test31ProbeGlobal_BaseIsolatedDeallocCfZ // CHECK-SYMB: // ProbeGlobal_BaseIsolatedDealloc.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test31ProbeGlobal_BaseIsolatedDeallocCfD : $@convention(method) (@owned ProbeGlobal_BaseIsolatedDealloc) -> () { class ProbeGlobal_BaseIsolatedDealloc: BaseIsolatedDealloc { #if !SILGEN @@ -408,7 +408,7 @@ class ProbeGlobal_BaseIsolatedDealloc: BaseIsolatedDealloc { // CHECK-SYMB-NOT: ProbeImplicit_DerivedIsolatedDealloc.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test36ProbeImplicit_DerivedIsolatedDeallocCfZ // CHECK-SYMB: // ProbeImplicit_DerivedIsolatedDealloc.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test36ProbeImplicit_DerivedIsolatedDeallocCfD : $@convention(method) (@owned ProbeImplicit_DerivedIsolatedDealloc) -> () { class ProbeImplicit_DerivedIsolatedDealloc: DerivedIsolatedDealloc {} @@ -434,7 +434,7 @@ class ProbeIsolated_DerivedIsolatedDealloc: DerivedIsolatedDealloc { // CHECK-SYMB-NOT: ProbeGlobal_DerivedIsolatedDealloc.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test34ProbeGlobal_DerivedIsolatedDeallocCfZ // CHECK-SYMB: // ProbeGlobal_DerivedIsolatedDealloc.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test34ProbeGlobal_DerivedIsolatedDeallocCfD : $@convention(method) (@owned ProbeGlobal_DerivedIsolatedDealloc) -> () { class ProbeGlobal_DerivedIsolatedDealloc: DerivedIsolatedDealloc { #if !SILGEN @@ -452,7 +452,7 @@ class ProbeGlobal_DerivedIsolatedDealloc: DerivedIsolatedDealloc { // CHECK-SYMB-NOT: ProbeImplicit_DeallocIsolatedFromProtocol.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test41ProbeImplicit_DeallocIsolatedFromProtocolCfZ // CHECK-SYMB: // ProbeImplicit_DeallocIsolatedFromProtocol.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test41ProbeImplicit_DeallocIsolatedFromProtocolCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromProtocol) -> () { class ProbeImplicit_DeallocIsolatedFromProtocol: DeallocIsolatedFromProtocol {} @@ -466,7 +466,7 @@ class ProbeGlobal_DeallocIsolatedFromProtocol: DeallocIsolatedFromProtocol { // CHECK-SYMB-NOT: ProbeImplicit_DeallocIsolatedFromCategory.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test41ProbeImplicit_DeallocIsolatedFromCategoryCfZ // CHECK-SYMB: // ProbeImplicit_DeallocIsolatedFromCategory.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test41ProbeImplicit_DeallocIsolatedFromCategoryCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromCategory) -> () { class ProbeImplicit_DeallocIsolatedFromCategory: DeallocIsolatedFromCategory {} @@ -480,7 +480,7 @@ class ProbeGlobal_DeallocIsolatedFromCategory: DeallocIsolatedFromCategory { // CHECK-SYMB-NOT: ProbeImplicit_DeallocIsolatedFromExtension.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s4test42ProbeImplicit_DeallocIsolatedFromExtensionCfZ // CHECK-SYMB: // ProbeImplicit_DeallocIsolatedFromExtension.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test42ProbeImplicit_DeallocIsolatedFromExtensionCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromExtension) -> () { class ProbeImplicit_DeallocIsolatedFromExtension: DeallocIsolatedFromExtension {} diff --git a/test/Concurrency/deinit_isolation_objc.swift b/test/Concurrency/deinit_isolation_objc.swift index b7f46518eb30e..374f38f78715c 100644 --- a/test/Concurrency/deinit_isolation_objc.swift +++ b/test/Concurrency/deinit_isolation_objc.swift @@ -27,7 +27,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: BaseWithNonisolatedDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc25BaseWithNonisolatedDeinitCfZ // CHECK-SYMB: // BaseWithNonisolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc25BaseWithNonisolatedDeinitCfD : $@convention(method) (@owned BaseWithNonisolatedDeinit) -> () { @objc class BaseWithNonisolatedDeinit : NSObject {} @@ -38,7 +38,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc34BaseWithDeinitIsolatedOnFirstActorCfZ : $@convention(thin) (@owned BaseWithDeinitIsolatedOnFirstActor) -> () { // CHECK-SYMB: BaseWithDeinitIsolatedOnFirstActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc34BaseWithDeinitIsolatedOnFirstActorCfD : $@convention(method) (@owned BaseWithDeinitIsolatedOnFirstActor) -> () { @objc class BaseWithDeinitIsolatedOnFirstActor : NSObject { @FirstActor deinit {} // expected-note 3{{overridden declaration is here}} @@ -57,7 +57,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc35BaseWithDeinitIsolatedOnSecondActorCfZ : $@convention(thin) (@owned BaseWithDeinitIsolatedOnSecondActor) -> () { // CHECK-SYMB: BaseWithDeinitIsolatedOnSecondActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc35BaseWithDeinitIsolatedOnSecondActorCfD : $@convention(method) (@owned BaseWithDeinitIsolatedOnSecondActor) -> () { @objc class BaseWithDeinitIsolatedOnSecondActor: NSObject { @SecondActor deinit {} // expected-note 3{{overridden declaration is here}} @@ -71,7 +71,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: ImplicitDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc19ImplicitDeinitActorCfZ // CHECK-SYMB: // ImplicitDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc19ImplicitDeinitActorCfD : $@convention(method) (@owned ImplicitDeinitActor) -> () { @objc actor ImplicitDeinitActor : NSObject { // nonisolated deinit @@ -83,7 +83,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: DefaultDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc18DefaultDeinitActorCfZ // CHECK-SYMB: // DefaultDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc18DefaultDeinitActorCfD : $@convention(method) (@owned DefaultDeinitActor) -> () { @objc actor DefaultDeinitActor : NSObject { // self-isolated deinit @@ -101,7 +101,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: actor_instance. name: 'self' // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc21PropagatedDeinitActorCfZ : $@convention(thin) (@owned PropagatedDeinitActor) -> () { // CHECK-SYMB: // PropagatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc21PropagatedDeinitActorCfD : $@convention(method) (@owned PropagatedDeinitActor) -> () { @objc actor PropagatedDeinitActor : NSObject { // self-isolated deinit @@ -118,7 +118,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: NonisolatedDeinitActor.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc22NonisolatedDeinitActorCfZ // CHECK-SYMB: // NonisolatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc22NonisolatedDeinitActorCfD : $@convention(method) (@owned NonisolatedDeinitActor) -> () { @objc actor NonisolatedDeinitActor : NSObject { // nonisolated deinit @@ -136,7 +136,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc19IsolatedDeinitActorCfZ : $@convention(thin) (@owned IsolatedDeinitActor) -> () { // CHECK-SYMB: // IsolatedDeinitActor.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc19IsolatedDeinitActorCfD : $@convention(method) (@owned IsolatedDeinitActor) -> () { @objc actor IsolatedDeinitActor : NSObject { // FirstActor-isolated deinit @@ -154,7 +154,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: ImplicitDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc14ImplicitDeinitCfZ // CHECK-SYMB: // ImplicitDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc14ImplicitDeinitCfD : $@convention(method) (@owned ImplicitDeinit) -> () { @FirstActor @objc class ImplicitDeinit : NSObject { @@ -167,7 +167,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: DefaultDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc13DefaultDeinitCfZ // CHECK-SYMB: // DefaultDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc13DefaultDeinitCfD : $@convention(method) (@owned DefaultDeinit) -> () { @FirstActor @objc class DefaultDeinit: NSObject { @@ -185,7 +185,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc16PropagatedDeinitCfZ : $@convention(thin) (@owned PropagatedDeinit) -> () { // CHECK-SYMB: // PropagatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc16PropagatedDeinitCfD : $@convention(method) (@owned PropagatedDeinit) -> () { @FirstActor @objc class PropagatedDeinit: NSObject { @@ -207,7 +207,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: NonisolatedDeinit.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc17NonisolatedDeinitCfZ // CHECK-SYMB: // NonisolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc17NonisolatedDeinitCfD : $@convention(method) (@owned NonisolatedDeinit) -> () { @FirstActor @objc class NonisolatedDeinit : NSObject { @@ -226,7 +226,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc14IsolatedDeinitCfZ : $@convention(thin) (@owned IsolatedDeinit) -> () { // CHECK-SYMB: // IsolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc14IsolatedDeinitCfD : $@convention(method) (@owned IsolatedDeinit) -> () { @objc class IsolatedDeinit : NSObject { // FirstActor-isolated deinit @@ -242,7 +242,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc23DifferentIsolatedDeinitCfZ : $@convention(thin) (@owned DifferentIsolatedDeinit) -> () { // CHECK-SYMB: // DifferentIsolatedDeinit.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc23DifferentIsolatedDeinitCfD : $@convention(method) (@owned DifferentIsolatedDeinit) -> () { @FirstActor @objc class DifferentIsolatedDeinit : NSObject { @@ -262,7 +262,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: ImplicitDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc32ImplicitDeinitInheritNonisolatedCfZ // CHECK-SYMB: // ImplicitDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc32ImplicitDeinitInheritNonisolatedCfD : $@convention(method) (@owned ImplicitDeinitInheritNonisolated) -> () { @FirstActor @objc class ImplicitDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -275,7 +275,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: // DefaultDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: sil hidden [ossa] @$s21deinit_isolation_objc31DefaultDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned DefaultDeinitInheritNonisolated) -> () { // CHECK-SYMB: // DefaultDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc31DefaultDeinitInheritNonisolatedCfD : $@convention(method) (@owned DefaultDeinitInheritNonisolated) -> () { @FirstActor @objc class DefaultDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -300,7 +300,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc34PropagatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned PropagatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // PropagatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc34PropagatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned PropagatedDeinitInheritNonisolated) -> () { @FirstActor @objc class PropagatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -316,7 +316,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NOT: NonisolatedDeinitInheritNonisolated.__isolated_deallocating_deinit // CHECK-SYMB-NOT: @$s21deinit_isolation_objc024NonisolatedDeinitInheritD0CfZ // CHECK-SYMB: // NonisolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc024NonisolatedDeinitInheritD0CfD : $@convention(method) (@owned NonisolatedDeinitInheritNonisolated) -> () { @FirstActor @objc class NonisolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -335,7 +335,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc32IsolatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned IsolatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // IsolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc32IsolatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned IsolatedDeinitInheritNonisolated) -> () { @objc class IsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { // FirstActor-isolated deinit @@ -351,7 +351,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc41DifferentIsolatedDeinitInheritNonisolatedCfZ : $@convention(thin) (@owned DifferentIsolatedDeinitInheritNonisolated) -> () { // CHECK-SYMB: // DifferentIsolatedDeinitInheritNonisolated.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc41DifferentIsolatedDeinitInheritNonisolatedCfD : $@convention(method) (@owned DifferentIsolatedDeinitInheritNonisolated) -> () { @FirstActor @objc class DifferentIsolatedDeinitInheritNonisolated: BaseWithNonisolatedDeinit { @@ -372,7 +372,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc30ImplicitDeinitInheritIsolated1CfZ : $@convention(thin) (@owned ImplicitDeinitInheritIsolated1) -> () { // CHECK-SYMB: // ImplicitDeinitInheritIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc30ImplicitDeinitInheritIsolated1CfD : $@convention(method) (@owned ImplicitDeinitInheritIsolated1) -> () { @FirstActor @objc class ImplicitDeinitInheritIsolated1: BaseWithDeinitIsolatedOnFirstActor { @@ -402,7 +402,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc29GoodPropagatedDeinitIsolated1CfZ : $@convention(thin) (@owned GoodPropagatedDeinitIsolated1) -> () { // CHECK-SYMB: // GoodPropagatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc29GoodPropagatedDeinitIsolated1CfD : $@convention(method) (@owned GoodPropagatedDeinitIsolated1) -> () { @objc class GoodPropagatedDeinitIsolated1: BaseIsolatedOnFirstActor { isolated deinit { @@ -417,7 +417,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc25PropagatedDeinitIsolated1CfZ : $@convention(thin) (@owned PropagatedDeinitIsolated1) -> () { // CHECK-SYMB: // PropagatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc25PropagatedDeinitIsolated1CfD : $@convention(method) (@owned PropagatedDeinitIsolated1) -> () { @FirstActor @objc class PropagatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { @@ -444,7 +444,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: FirstActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc23IsolatedDeinitIsolated1CfZ : $@convention(thin) (@owned IsolatedDeinitIsolated1) -> () { // CHECK-SYMB: // IsolatedDeinitIsolated1.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc23IsolatedDeinitIsolated1CfD : $@convention(method) (@owned IsolatedDeinitIsolated1) -> () { @objc class IsolatedDeinitIsolated1: BaseWithDeinitIsolatedOnFirstActor { // FirstActor-isolated deinit @@ -472,7 +472,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc30ImplicitDeinitInheritIsolated2CfZ : $@convention(thin) (@owned ImplicitDeinitInheritIsolated2) -> () { // CHECK-SYMB: // ImplicitDeinitInheritIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc30ImplicitDeinitInheritIsolated2CfD : $@convention(method) (@owned ImplicitDeinitInheritIsolated2) -> () { @FirstActor @objc class ImplicitDeinitInheritIsolated2: BaseWithDeinitIsolatedOnSecondActor { @@ -486,7 +486,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc29GoodPropagatedDeinitIsolated2CfZ : $@convention(thin) (@owned GoodPropagatedDeinitIsolated2) -> () { // CHECK-SYMB: // GoodPropagatedDeinitIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc29GoodPropagatedDeinitIsolated2CfD : $@convention(method) (@owned GoodPropagatedDeinitIsolated2) -> () { @objc class GoodPropagatedDeinitIsolated2: BaseIsolatedOnSecondActor { isolated deinit { @@ -532,7 +532,7 @@ func isolatedFunc() {} // expected-note 15{{calls to global function 'isolatedF // CHECK-SYMB-NEXT: // Isolation: global_actor. type: SecondActor // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc32DifferentIsolatedDeinitIsolated2CfZ : $@convention(thin) (@owned DifferentIsolatedDeinitIsolated2) -> () { // CHECK-SYMB: // DifferentIsolatedDeinitIsolated2.__deallocating_deinit -// CHECK-SYMB-NEXT: // Isolation: nonisolated +// CHECK-SYMB-NEXT: // Isolation: concurrent // CHECK-SYMB-NEXT: sil hidden [ossa] @$s21deinit_isolation_objc32DifferentIsolatedDeinitIsolated2CfD : $@convention(method) (@owned DifferentIsolatedDeinitIsolated2) -> () { @FirstActor @objc class DifferentIsolatedDeinitIsolated2: BaseWithDeinitIsolatedOnSecondActor { diff --git a/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift b/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift index e073badfbf2ac..4605287bb1695 100644 --- a/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift +++ b/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift @@ -130,11 +130,11 @@ func test_CallerSyncNormal_CalleeSyncNonIsolated() async { normalAcceptsClosure { } // CHECK-LABEL: closure #2 in test_CallerSyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendingClosure { } // CHECK-LABEL: // closure #3 in test_CallerSyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendableClosure { } } @@ -168,11 +168,11 @@ func test_CallerSyncNormal_CalleeSyncMainActorIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() -> ()' to main actor-isolated global function 'normalGlobalActorAcceptsClosure' risks causing races in between global actor 'CustomActor'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in test_CallerSyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendingClosure { } // CHECK-LABEL: // closure #3 in test_CallerSyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendableClosure { } } @@ -209,11 +209,11 @@ func test_CallerSyncNormal_CalleeAsyncNonIsolated() async { normalAcceptsAsyncClosure { } // CHECK-LABEL: closure #2 in test_CallerSyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendingAsyncClosure { } // CHECK-LABEL: // closure #3 in test_CallerSyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendableAsyncClosure { } } @@ -244,11 +244,11 @@ func test_CallerSyncNormal_CalleeAsyncMainActorIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() async -> ()' to main actor-isolated global function 'normalGlobalActorAcceptsAsyncClosure' risks causing races in between global actor 'CustomActor'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in test_CallerSyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendingAsyncClosure { } // CHECK-LABEL: // closure #3 in test_CallerSyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendableAsyncClosure { } } @@ -285,11 +285,11 @@ func test_CallerAsyncNormal_CalleeSyncNonIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() -> ()' to nonisolated global function 'asyncNormalAcceptsClosure' risks causing races in between global actor 'CustomActor'-isolated and nonisolated uses}} // CHECK-LABEL: closure #2 in test_CallerAsyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendingClosure { } // CHECK-LABEL: // closure #3 in test_CallerAsyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendableClosure { } } @@ -324,11 +324,11 @@ func test_CallerAsyncNormal_CalleeSyncMainActorIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() -> ()' to main actor-isolated global function 'asyncNormalGlobalActorAcceptsClosure' risks causing races in between global actor 'CustomActor'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in test_CallerAsyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendingClosure { } // CHECK-LABEL: // closure #3 in test_CallerAsyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendableClosure { } } @@ -367,11 +367,11 @@ func test_CallerAsyncNormal_CalleeAsyncNonIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() async -> ()' to nonisolated global function 'asyncNormalAcceptsAsyncClosure' risks causing races in between global actor 'CustomActor'-isolated and nonisolated uses}} // CHECK-LABEL: closure #2 in test_CallerAsyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendingAsyncClosure { } // CHECK-LABEL: // closure #3 in test_CallerAsyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendableAsyncClosure { } } @@ -410,11 +410,11 @@ func test_CallerAsyncNormal_CalleeAsyncMainActorIsolated() async { // expected-note @-1 {{sending global actor 'CustomActor'-isolated value of non-Sendable type '() async -> ()' to main actor-isolated global function 'asyncNormalGlobalActorAcceptsAsyncClosure' risks causing races in between global actor 'CustomActor'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in test_CallerAsyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendingAsyncClosure { } // CHECK-LABEL: // closure #3 in test_CallerAsyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendableAsyncClosure { } } @@ -456,11 +456,11 @@ extension MyActor { normalAcceptsClosure { print(self) } // CHECK-LABEL: closure #2 in MyActor.test_CallerSyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendingClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerSyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendableClosure { print(self) } } @@ -493,11 +493,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() -> ()' to main actor-isolated global function 'normalGlobalActorAcceptsClosure' risks causing races in between 'self'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in MyActor.test_CallerSyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendingClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerSyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendableClosure { print(self) } } @@ -537,11 +537,11 @@ extension MyActor { normalAcceptsAsyncClosure { print(self) } // CHECK-LABEL: closure #2 in MyActor.test_CallerSyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendingAsyncClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerSyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent normalAcceptsSendableAsyncClosure { print(self) } } @@ -570,11 +570,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() async -> ()' to main actor-isolated global function 'normalGlobalActorAcceptsAsyncClosure' risks causing races in between 'self'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in MyActor.test_CallerSyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendingAsyncClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerSyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await normalGlobalActorAcceptsSendableAsyncClosure { print(self) } } @@ -612,11 +612,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() -> ()' to nonisolated global function 'asyncNormalAcceptsClosure' risks causing races in between 'self'-isolated and nonisolated uses}} // CHECK-LABEL: closure #2 in MyActor.test_CallerAsyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendingClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerAsyncNormal_CalleeSyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendableClosure { print(self) } } @@ -650,11 +650,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() -> ()' to main actor-isolated global function 'asyncNormalGlobalActorAcceptsClosure' risks causing races in between 'self'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in MyActor.test_CallerAsyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendingClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerAsyncNormal_CalleeSyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendableClosure { print(self) } } @@ -695,11 +695,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() async -> ()' to nonisolated global function 'asyncNormalAcceptsAsyncClosure' risks causing races in between 'self'-isolated and nonisolated uses}} // CHECK-LABEL: closure #2 in MyActor.test_CallerAsyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendingAsyncClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerAsyncNormal_CalleeAsyncNonIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalAcceptsSendableAsyncClosure { print(self) } } @@ -736,11 +736,11 @@ extension MyActor { // expected-note @-1 {{sending 'self'-isolated value of non-Sendable type '() async -> ()' to main actor-isolated global function 'asyncNormalGlobalActorAcceptsAsyncClosure' risks causing races in between 'self'-isolated and main actor-isolated uses}} // CHECK-LABEL: // closure #2 in MyActor.test_CallerAsyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendingAsyncClosure { print(self) } // CHECK-LABEL: // closure #3 in MyActor.test_CallerAsyncNormal_CalleeAsyncMainActorIsolated() - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent await asyncNormalGlobalActorAcceptsSendableAsyncClosure { print(self) } } diff --git a/test/Frontend/dump-parse.swift b/test/Frontend/dump-parse.swift index 42e641e331ace..d107878db519b 100644 --- a/test/Frontend/dump-parse.swift +++ b/test/Frontend/dump-parse.swift @@ -67,14 +67,14 @@ escaping({ $0 }) // CHECK-AST: (declref_expr type="(@escaping (Int) -> Int) -> ()" // CHECK-AST-NEXT: (argument_list // CHECK-AST-NEXT: (argument -// CHECK-AST-NEXT: (closure_expr type="(Int) -> Int" {{.*}} discriminator=0 nonisolated escaping single_expression +// CHECK-AST-NEXT: (closure_expr type="(Int) -> Int" {{.*}} discriminator=0 concurrent escaping single_expression func nonescaping(_: (Int) -> Int) {} nonescaping({ $0 }) // CHECK-AST: (declref_expr type="((Int) -> Int) -> ()" // CHECK-AST-NEXT: (argument_list // CHECK-AST-NEXT: (argument -// CHECK-AST-NEXT: (closure_expr type="(Int) -> Int" {{.*}} discriminator=1 nonisolated single_expression +// CHECK-AST-NEXT: (closure_expr type="(Int) -> Int" {{.*}} discriminator=1 concurrent single_expression // CHECK-LABEL: (struct_decl range=[{{.+}}] "MyStruct") struct MyStruct {} diff --git a/test/SILGen/functions.swift b/test/SILGen/functions.swift index e556817c39bbe..04e1f042b88ba 100644 --- a/test/SILGen/functions.swift +++ b/test/SILGen/functions.swift @@ -489,7 +489,7 @@ func testNoescape() { // Despite being a noescape closure, this needs to capture 'a' by-box so it can // be passed to the capturing closure.closure // CHECK: closure #1 () -> () in functions.testNoescape() -> () -// CHECK-NEXT: Isolation: nonisolated +// CHECK-NEXT: Isolation: concurrent // CHECK-NEXT: sil private [ossa] @$s9functions12testNoescapeyyFyyXEfU_ : $@convention(thin) (@guaranteed { var Int }) -> () { @@ -510,9 +510,9 @@ func testNoescape2() { // CHECK-LABEL: sil hidden [ossa] @$s9functions13testNoescape2yyF : $@convention(thin) () -> () { // CHECK: // closure #1 () -> () in functions.testNoescape2() -> () -// CHECK-NEXT: Isolation: nonisolated +// CHECK-NEXT: Isolation: concurrent // CHECK-NEXT: sil private [ossa] @$s9functions13testNoescape2yyFyyXEfU_ : $@convention(thin) (@guaranteed { var Int }) -> () { // CHECK: // closure #1 () -> () in closure #1 () -> () in functions.testNoescape2() -> () -// CHECK-NEXT: Isolation: nonisolated +// CHECK-NEXT: Isolation: concurrent // CHECK-NEXT: sil private [ossa] @$s9functions13testNoescape2yyFyyXEfU_yycfU_ : $@convention(thin) (@guaranteed { var Int }) -> () { diff --git a/test/SILGen/nonisolated_inherits_isolation.swift b/test/SILGen/nonisolated_inherits_isolation.swift index 5bbbe38a146ad..1fd5b938e91c2 100644 --- a/test/SILGen/nonisolated_inherits_isolation.swift +++ b/test/SILGen/nonisolated_inherits_isolation.swift @@ -18,7 +18,7 @@ func unspecifiedAsyncUse(_ t: NonSendableKlass) async {} //===----------------------------------------------------------------------===// // CHECK-LABEL: // nonisolatedAsync() -// CHECK-NEXT: Isolation: caller_isolation_inheriting +// CHECK-NEXT: Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation0A5AsyncyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { // CHECK: bb0([[ACTOR:%.*]] : @guaranteed $Optional): // CHECK: hop_to_executor [[ACTOR]] @@ -28,7 +28,7 @@ nonisolated func nonisolatedAsync() async {} func unspecifiedAsyncCallee() async {} // CHECK-LABEL: // unspecifiedAsync() -// CHECK-NEXT: Isolation: caller_isolation_inheriting +// CHECK-NEXT: Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation16unspecifiedAsyncyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { // CHECK: bb0([[ARG:%.*]] : @guaranteed $Optional): // CHECK: hop_to_executor [[ACTOR]] @@ -52,7 +52,7 @@ struct NonisolatedStruct { // Do apply it to sync initializers. // // CHECK-LABEL: // NonisolatedStruct.init(asynchronous:) - // CHECK-NEXT: // Isolation: caller_isolation_inheriting + // CHECK-NEXT: // Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation17NonisolatedStructV12asynchronousACyt_tYacfC : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @thin NonisolatedStruct.Type) -> NonisolatedStruct { // CHECK: } // end sil function '$s30nonisolated_inherits_isolation17NonisolatedStructV12asynchronousACyt_tYacfC' init(asynchronous: ()) async {} @@ -62,14 +62,14 @@ struct NonisolatedStruct { // But do apply it to async methods. // CHECK-LABEL: // NonisolatedStruct.asyncMethod() - // CHECK-NEXT: // Isolation: caller_isolation_inheriting + // CHECK-NEXT: // Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation17NonisolatedStructV11asyncMethodyyYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, NonisolatedStruct) -> () { // CHECK: } // end sil function '$s30nonisolated_inherits_isolation17NonisolatedStructV11asyncMethodyyYaF' func asyncMethod() async {} } // CHECK-LABEL: // useNonisolatedStruct() -// CHECK-NEXT: // Isolation: caller_isolation_inheriting +// CHECK-NEXT: // Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation20useNonisolatedStructyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { // CHECK: bb0([[ACTOR:%.*]] : // CHECK: hop_to_executor [[ACTOR]] @@ -89,7 +89,7 @@ func useNonisolatedStruct() async { } // CHECK-LABEL: // useNonisolatedStruct2() -// CHECK-NEXT: // Isolation: caller_isolation_inheriting +// CHECK-NEXT: // Isolation: nonisolated // CHECK-NEXT: sil hidden [ossa] @$s30nonisolated_inherits_isolation21useNonisolatedStruct2yyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional) -> () { // CHECK: bb0([[ACTOR:%.*]] : // CHECK: hop_to_executor [[ACTOR]] diff --git a/test/SILGen/synthesized_conformance_enum.swift b/test/SILGen/synthesized_conformance_enum.swift index ed52b0bb8e5ae..a944c9c896acc 100644 --- a/test/SILGen/synthesized_conformance_enum.swift +++ b/test/SILGen/synthesized_conformance_enum.swift @@ -62,7 +62,7 @@ extension Enum: Codable where T: Codable {} extension NoValues: CaseIterable {} // CHECK-LABEL: // static NoValues.allCases.getter -// CHECK-NEXT: // Isolation: nonisolated +// CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil hidden [ossa] @$s28synthesized_conformance_enum8NoValuesO8allCasesSayACGvgZ : $@convention(method) (@thin NoValues.Type) -> @owned Array { extension NoValues: Codable {} diff --git a/test/SILOptimizer/moveonly_raw_layout.swift b/test/SILOptimizer/moveonly_raw_layout.swift index 18de20759f942..f10ceb0db2c0e 100644 --- a/test/SILOptimizer/moveonly_raw_layout.swift +++ b/test/SILOptimizer/moveonly_raw_layout.swift @@ -30,7 +30,7 @@ struct Lock: ~Copyable { } // CHECK-LABEL: // Lock.deinit - // CHECK-NEXT: // Isolation: nonisolated + // CHECK-NEXT: // Isolation: concurrent // CHECK-NEXT: sil{{.*}} @[[DEINIT:\$.*4LockV.*fD]] : deinit { // CHECK-NOT: destroy_addr diff --git a/test/Sema/property_wrappers.swift b/test/Sema/property_wrappers.swift index 23383634ea19d..4e5608b6c799e 100644 --- a/test/Sema/property_wrappers.swift +++ b/test/Sema/property_wrappers.swift @@ -70,8 +70,8 @@ public class W_58201 { struct S1_58201 { // CHECK: argument_list implicit labels="wrappedValue:" // CHECK-NEXT: argument label="wrappedValue" - // CHECK-NEXT: autoclosure_expr implicit type="() -> Bool?" discriminator=0 nonisolated captures=( ) escaping - // CHECK: autoclosure_expr implicit type="() -> Bool?" discriminator=1 nonisolated escaping + // CHECK-NEXT: autoclosure_expr implicit type="() -> Bool?" discriminator=0 concurrent captures=( ) escaping + // CHECK: autoclosure_expr implicit type="() -> Bool?" discriminator=1 concurrent escaping @W_58201 var a: Bool? } @@ -79,8 +79,8 @@ struct S1_58201 { struct S2_58201 { // CHECK: argument_list implicit labels="wrappedValue:" // CHECK-NEXT: argument label="wrappedValue" - // CHECK-NEXT: autoclosure_expr implicit type="() -> Bool" location={{.*}}.swift:[[@LINE+2]]:26 range=[{{.+}}] discriminator=0 nonisolated captures=( ) escaping - // CHECK: autoclosure_expr implicit type="() -> Bool" location={{.*}}.swift:[[@LINE+1]]:26 range=[{{.+}}] discriminator=1 nonisolated escaping + // CHECK-NEXT: autoclosure_expr implicit type="() -> Bool" location={{.*}}.swift:[[@LINE+2]]:26 range=[{{.+}}] discriminator=0 concurrent captures=( ) escaping + // CHECK: autoclosure_expr implicit type="() -> Bool" location={{.*}}.swift:[[@LINE+1]]:26 range=[{{.+}}] discriminator=1 concurrent escaping @W_58201 var b: Bool = false } diff --git a/test/expr/capture/dynamic_self.swift b/test/expr/capture/dynamic_self.swift index 65bcd931b6056..8e3b24b9e5339 100644 --- a/test/expr/capture/dynamic_self.swift +++ b/test/expr/capture/dynamic_self.swift @@ -4,7 +4,7 @@ class Android { func clone() -> Self { - // CHECK: closure_expr type="() -> Self" {{.*}} discriminator=0 nonisolated captures=( self) + // CHECK: closure_expr type="() -> Self" {{.*}} discriminator=0 concurrent captures=( self) let fn = { return self } return fn() } diff --git a/test/expr/capture/generic_params.swift b/test/expr/capture/generic_params.swift index 756c6ef1b570b..7236041ce5437 100644 --- a/test/expr/capture/generic_params.swift +++ b/test/expr/capture/generic_params.swift @@ -6,16 +6,16 @@ func doSomething(_ t: T) {} func outerGeneric(t: T, x: AnyObject) { // Simple case -- closure captures outer generic parameter - // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=0 nonisolated captures=( t) escaping single_expression + // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=0 concurrent captures=( t) escaping single_expression _ = { doSomething(t) } // Special case -- closure does not capture outer generic parameters - // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=1 nonisolated captures=(x) escaping single_expression + // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=1 concurrent captures=(x) escaping single_expression _ = { doSomething(x) } // Special case -- closure captures outer generic parameter, but it does not // appear as the type of any expression - // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=2 nonisolated captures=( x) + // CHECK: closure_expr type="() -> ()" {{.*}} discriminator=2 concurrent captures=( x) _ = { if x is T {} } // Nested generic functions always capture outer generic parameters, even if diff --git a/test/expr/capture/nested.swift b/test/expr/capture/nested.swift index cd1c8adf4d2a1..24b2b3a0b4115 100644 --- a/test/expr/capture/nested.swift +++ b/test/expr/capture/nested.swift @@ -2,9 +2,9 @@ // CHECK: func_decl{{.*}}"foo2(_:)" func foo2(_ x: Int) -> (Int) -> (Int) -> Int { - // CHECK: closure_expr type="(Int) -> (Int) -> Int" {{.*}} discriminator=0 nonisolated captures=(x) + // CHECK: closure_expr type="(Int) -> (Int) -> Int" {{.*}} discriminator=0 concurrent captures=(x) return {(bar: Int) -> (Int) -> Int in - // CHECK: closure_expr type="(Int) -> Int" {{.*}} discriminator=0 nonisolated captures=(x, bar) + // CHECK: closure_expr type="(Int) -> Int" {{.*}} discriminator=0 concurrent captures=(x, bar) return {(bas: Int) -> Int in return x + bar + bas }