Skip to content

Grammatical corrections for compound modifiers #76337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ And the module structure to support such applications looks like this:

* [SE-0430][]:

Region Based Isolation is now extended to enable the application of an
Region-Based Isolation is now extended to enable the application of an
explicit `sending` annotation to function parameters and results. A function
parameter or result that is annotated with `sending` is required to be
disconnected at the function boundary and thus possesses the capability of
Expand Down Expand Up @@ -485,7 +485,7 @@ And the module structure to support such applications looks like this:

func useValue() {
let x = NonSendableType()
let a = await MyActor(x) // Error without Region Based Isolation!
let a = await MyActor(x) // Error without Region-Based Isolation!
}
```

Expand Down
10 changes: 5 additions & 5 deletions include/swift/AST/DiagnosticsSIL.def
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,10 @@ NOTE(sil_referencebinding_inout_binding_here, none,
())

//===----------------------------------------------------------------------===//
// MARK: Region Based Isolation Diagnostics
// MARK: Region-Based Isolation Diagnostics
//===----------------------------------------------------------------------===//

// READ THIS: Please when adding diagnostics for region based isolation, keep
// READ THIS: Please when adding diagnostics for region-based isolation, keep
// them ordered in sections depending on which emitter uses it. It makes it
// easier for people unfamiliar with the code to quickly see which diagnostics
// are used by which of the SendNonSendable emitters use.
Expand All @@ -974,7 +974,7 @@ NOTE(sil_referencebinding_inout_binding_here, none,
// Misc

ERROR(regionbasedisolation_unknown_pattern, none,
"pattern that the region based isolation checker does not understand how to check. Please file a bug",
"pattern that the region-based isolation checker does not understand how to check. Please file a bug",
())
NOTE(regionbasedisolation_maybe_race, none,
"access can happen concurrently", ())
Expand Down Expand Up @@ -1096,13 +1096,13 @@ NOTE(regionbasedisolation_typed_sendneversendable_via_arg_callee, none,
// Error that is only used when the send non sendable emitter cannot discover any
// information to give a better diagnostic.
ERROR(regionbasedisolation_task_or_actor_isolated_sent, none,
"task or actor isolated value cannot be sent", ())
"task or actor-isolated value cannot be sent", ())

//===
// InOut Sending Emitter

NOTE(regionbasedisolation_inout_sending_must_be_reinitialized, none,
"'inout sending' parameter must be reinitialized before function exit with a non-actor isolated value",
"'inout sending' parameter must be reinitialized before function exit with a non-actor-isolated value",
())
ERROR(regionbasedisolation_inout_sending_cannot_be_actor_isolated, none,
"'inout sending' parameter %0 cannot be %1at end of function",
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -5749,7 +5749,7 @@ NOTE(note_actor_isolated_witness,none,
"%0 %kind1 cannot satisfy %2 requirement",
(ActorIsolation, const ValueDecl *, ActorIsolation))
ERROR(actor_cannot_conform_to_global_actor_protocol,none,
"actor %0 cannot conform to global actor isolated protocol %1",
"actor %0 cannot conform to global-actor-isolated protocol %1",
(Type, Type))
NOTE(protocol_isolated_to_global_actor_here,none,
"%0 is isolated to global actor %1 here", (Type, Type))
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ def platform_c_calling_convention_EQ :

def disable_sending_args_and_results_with_region_isolation : Flag<["-"],
"disable-sending-args-and-results-with-region-based-isolation">,
HelpText<"Disable sending args and results when region based isolation is enabled. Only enabled with asserts">,
HelpText<"Disable sending args and results when region-based isolation is enabled. Only enabled with asserts">,
Flags<[HelpHidden]>;

def scanner_module_validation: Flag<["-"], "scanner-module-validation">,
Expand Down
4 changes: 2 additions & 2 deletions include/swift/SILOptimizer/Analysis/RegionAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ class RegionAnalysisValueMap {
}

/// Returns the value for this instruction if it isn't a fake "represenative
/// value" to inject actor isolatedness. Asserts in such a case.
/// value" to inject actor isolation. Asserts in such a case.
SILValue getRepresentative(Element trackableValueID) const;

/// Returns the value for this instruction. If it is a fake "representative
/// value" returns an empty SILValue.
SILValue maybeGetRepresentative(Element trackableValueID) const;

/// Returns the value for this instruction if it isn't a fake "represenative
/// value" to inject actor isolatedness. Asserts in such a case.
/// value" to inject actor isolation. Asserts in such a case.
RepresentativeValue getRepresentativeValue(Element trackableValueID) const;

/// Returns the fake "representative value" for this element if it
Expand Down
6 changes: 3 additions & 3 deletions include/swift/SILOptimizer/Utils/PartitionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class RegionAnalysisValueMap;
/// The representative value of the equivalence class that makes up a tracked
/// value.
///
/// We use a wrapper struct here so that we can inject "fake" actor isolated
/// We use a wrapper struct here so that we can inject "fake" actor-isolated
/// values into the regions of values that become merged into an actor by
/// calling a function without a non-sendable result.
class RepresentativeValue {
Expand All @@ -103,8 +103,8 @@ class RepresentativeValue {

/// If this is set to a SILValue then it is the actual represented value. If
/// it is set to a SILInstruction, then this is a "fake" representative value
/// used to inject actor isolatedness. The instruction stored is the
/// instruction that introduced the actor isolated-ness.
/// used to inject actor isolation. The instruction stored is the
/// instruction that introduced the actor isolation.
InnerType value;

public:
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Utils/SILIsolationInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class SILIsolationInfo {
/// for the isolated values if any to not match.
///
/// This is useful if one has two non-Sendable values projected from the same
/// actor or global actor isolated value. E.x.: two different ref_element_addr
/// actor or global-actor-isolated value. E.x.: two different ref_element_addr
/// from the same actor.
bool hasSameIsolation(const SILIsolationInfo &other) const;

Expand Down
2 changes: 1 addition & 1 deletion lib/DriverTool/sil_opt_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ int sil_opt_main(ArrayRef<const char *> argv, void *MainAddr) {
}

// If we have strict concurrency set as a feature and were told to turn off
// region based isolation... do so now.
// region-based isolation... do so now.
if (Invocation.getLangOptions().hasFeature(Feature::StrictConcurrency)) {
Invocation.getLangOptions().enableFeature(Feature::RegionBasedIsolation);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ FunctionTypeInfo SILGenFunction::getClosureTypeInfo(AbstractClosureExpr *expr) {
auto fnType = cast<AnyFunctionType>(expr->getType()->getCanonicalType());

// If we have a closure expr that has inherits actor context, work around AST
// issues that causes us to be able to get non-Sendable actor isolated
// issues that causes us to be able to get non-Sendable actor-isolated
// closures.
if (auto *ce = dyn_cast<ClosureExpr>(expr)) {
if (ce->inheritsActorContext() && fnType->isAsync() &&
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenConcurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void SILGenFunction::emitExpectedExecutorProlog() {
}();

// FIXME: Avoid loading and checking the expected executor if concurrency is
// unavailable. This is specifically relevant for MainActor isolated contexts,
// unavailable. This is specifically relevant for MainActor-isolated contexts,
// which are allowed to be available on OSes where concurrency is not
// available. rdar://106827064

Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
FunctionTypeInfo getFunctionTypeInfo(CanAnyFunctionType fnType);

/// A helper method that calls getFunctionTypeInfo that also marks global
/// actor isolated async closures that are not sendable as sendable.
/// actor-isolated async closures that are not sendable as sendable.
FunctionTypeInfo getClosureTypeInfo(AbstractClosureExpr *expr);

bool isEmittingTopLevelCode() { return IsEmittingTopLevelCode; }
Expand Down
6 changes: 3 additions & 3 deletions lib/SILOptimizer/Analysis/RegionAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ struct PartitionOpBuilder {
lookupValueID(rep), lookupValueID(srcOperand->get()), srcOperand));
}

/// Mark \p value artifically as being part of an actor isolated region by
/// Mark \p value artifically as being part of an actor-isolated region by
/// introducing a new fake actor introducing representative and merging them.
void addActorIntroducingInst(SILValue sourceValue, Operand *sourceOperand,
SILIsolationInfo actorIsolation) {
Expand Down Expand Up @@ -1794,7 +1794,7 @@ struct PartitionOpBuilder {
namespace {

enum class TranslationSemantics {
/// An instruction that does not affect region based state or if it does we
/// An instruction that does not affect region-based state or if it does we
/// would like to error on some other use. An example would be something
/// like end_borrow, inject_enum_addr, or alloc_global. We do not produce
/// any partition op.
Expand Down Expand Up @@ -2474,7 +2474,7 @@ class PartitionOpTranslator {
void translateSILPartialApply(PartialApplyInst *pai) {
// First check if our partial apply is Sendable and not global actor
// isolated. In such a case, we will have emitted an earlier warning in Sema
// and can return early. If we have a global actor isolated partial_apply,
// and can return early. If we have a global-actor-isolated partial_apply,
// we can be looser and can use region isolation since we know that the
// Sendable closure will be executed serially due to the closure having to
// run on the global actor queue meaning that we do not have to worry about
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/SendNonSendable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ struct UseAfterSendDiagnosticInferrer::AutoClosureWalker : ASTWalker {
continue;
}

// Otherwise, we are calling an actor isolated function in the async
// Otherwise, we are calling an actor-isolated function in the async
// let. Emit a better error.

// See if we can find a valueDecl/name for our callee so we can
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Utils/RegionIsolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LoggingFlag swift::regionisolation::ENABLE_LOGGING;
static llvm::cl::opt<LoggingFlag, true> // The parser
RegionBasedIsolationLog(
"sil-regionbasedisolation-log",
llvm::cl::desc("Enable logging for SIL region based isolation "
llvm::cl::desc("Enable logging for SIL region-based isolation "
"diagnostics"),
llvm::cl::Hidden,
llvm::cl::values(
Expand Down
14 changes: 7 additions & 7 deletions lib/SILOptimizer/Utils/SILIsolationInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
}
}

// See if we have a struct_extract from a global actor isolated type.
// See if we have a struct_extract from a global-actor-isolated type.
if (auto *sei = dyn_cast<StructExtractInst>(inst)) {
auto varIsolation = swift::getActorIsolation(sei->getField());
if (auto isolation =
Expand All @@ -729,12 +729,12 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
varIsolation.isNonisolatedUnsafe());
}

// See if we have an unchecked_enum_data from a global actor isolated type.
// See if we have an unchecked_enum_data from a global-actor-isolated type.
if (auto *uedi = dyn_cast<UncheckedEnumDataInst>(inst)) {
return SILIsolationInfo::getGlobalActorIsolated(uedi, uedi->getEnumDecl());
}

// See if we have an unchecked_enum_data from a global actor isolated type.
// See if we have an unchecked_enum_data from a global-actor-isolated type.
if (auto *utedi = dyn_cast<UncheckedTakeEnumDataAddrInst>(inst)) {
return SILIsolationInfo::getGlobalActorIsolated(utedi,
utedi->getEnumDecl());
Expand All @@ -754,7 +754,7 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
}
}

// See if we have a convert function from a Sendable actor isolated function,
// See if we have a convert function from a Sendable actor-isolated function,
// we want to treat the result of the convert function as being actor isolated
// so that we cannot escape the value.
//
Expand Down Expand Up @@ -865,7 +865,7 @@ SILIsolationInfo SILIsolationInfo::get(SILArgument *arg) {
if (!SILIsolationInfo::isNonSendableType(arg->getType(), arg->getFunction()))
return {};

// Handle a switch_enum from a global actor isolated type.
// Handle a switch_enum from a global-actor-isolated type.
if (auto *phiArg = dyn_cast<SILPhiArgument>(arg)) {
if (auto *singleTerm = phiArg->getSingleTerminator()) {
if (auto *swi = dyn_cast<SwitchEnumInst>(singleTerm)) {
Expand Down Expand Up @@ -913,7 +913,7 @@ SILIsolationInfo SILIsolationInfo::get(SILArgument *arg) {
// disconnected so we can construct the actor value. Users cannot write
// allocator functions so we just need to worry about compiler generated
// code. In the case of a non-actor, we can only have an allocator that is
// global actor isolated, so we will never hit this code path.
// global-actor isolated, so we will never hit this code path.
if (declRef.kind == SILDeclRef::Kind::Allocator) {
if (auto isolation = fArg->getFunction()->getActorIsolation()) {
if (isolation->isActorInstanceIsolated()) {
Expand Down Expand Up @@ -1068,7 +1068,7 @@ bool SILIsolationInfo::hasSameIsolation(const SILIsolationInfo &other) const {
// If either have an actor instance, and the actor instance doesn't match,
// return false.
//
// This ensures that cases like comparing two global actor isolated things
// This ensures that cases like comparing two global-actor-isolated things
// do not hit this path.
//
// It also catches cases where we have a missing actor instance.
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/ConstraintSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5173,7 +5173,7 @@ ConstraintSystem::inferKeyPathLiteralCapability(KeyPathExpr *keyPath) {
case ActorIsolation::Erased:
llvm_unreachable("storage cannot have opaque isolation");

// A reference to an actor isolated state makes key path non-Sendable.
// A reference to an actor-isolated state makes key path non-Sendable.
case ActorIsolation::ActorInstance:
case ActorIsolation::GlobalActor:
isSendable = false;
Expand Down
10 changes: 5 additions & 5 deletions lib/Sema/TypeCheckConcurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ static bool wasLegacyEscapingUseRestriction(AbstractFunctionDecl *fn) {
return !(fn->hasAsync()); // basic case: not async = had restriction.
}

/// Note that while a direct access to the actor isolated property is not legal
/// Note that while a direct access to the actor-isolated property is not legal
/// you may want to consider introducing an accessing method for a mutation.
static void
maybeNoteMutatingMethodSuggestion(ASTContext &C,
Expand Down Expand Up @@ -2997,7 +2997,7 @@ namespace {
auto *patternBindingDecl = getTopPatternBindingDecl();
if (patternBindingDecl && patternBindingDecl->isAsyncLet()) {
// Defer diagnosing checking of non-Sendable types that are passed
// into async let to SIL level region based isolation.
// into async let to SIL level region-based isolation.
return;
}

Expand Down Expand Up @@ -4801,7 +4801,7 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
// If the local function is not Sendable, its isolation differs
// from that of the context, and both contexts are actor isolated,
// then capturing non-Sendable values allows the closure to stash
// those values into actor isolated state. The original context
// those values into actor-isolated state. The original context
// may also stash those values into isolated state, enabling concurrent
// access later on.
isolatedStateMayEscape =
Expand Down Expand Up @@ -7826,8 +7826,8 @@ ActorReferenceResult ActorReferenceResult::forReference(
return forSameConcurrencyDomain(declIsolation, options);
}

// Initializing an actor isolated stored property with a value effectively
// passes that value from the init context into the actor isolated context.
// Initializing an actor-isolated stored property with a value effectively
// passes that value from the init context into the actor-isolated context.
// It's only okay for the value to cross isolation boundaries if the property
// type is Sendable. Note that if the init is a nonisolated actor init,
// Sendable checking is already performed on arguments at the call-site.
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ TypeCheckPrimaryFileRequest::evaluate(Evaluator &eval, SourceFile *SF) const {
SF->typeCheckDelayedFunctions();
}

// If region based isolation is enabled, we diagnose unnecessary
// If region-based isolation is enabled, we diagnose unnecessary
// preconcurrency imports in the SIL pipeline in the
// DiagnoseUnnecessaryPreconcurrencyImports pass.
if (!Ctx.LangOpts.hasFeature(Feature::RegionBasedIsolation))
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/Runtime/actor_assume_executor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import StdlibUnittest

func checkAssumeMainActor(echo: MainActorEcho) /* synchronous! */ {
// Echo.get("any") // error: main actor isolated, cannot perform async call here
// Echo.get("any") // error: MainActor isolated, cannot perform async call here
MainActor.assumeIsolated {
let input = "example"
let got = echo.get(input)
Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/actor_inout_isolation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// - can't pass it into a curried/partially applied function
// - can't pass it inout to a function that doesn't directly touch it
// - can't pass it into a function that was passed into the calling method
// - can't call async mutating function on actor isolated state
// - can't call async mutating function on actor-isolated state

struct Point {
var x: Int
Expand Down
4 changes: 2 additions & 2 deletions test/Concurrency/actor_isolation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1264,11 +1264,11 @@ func testGlobalActorInheritance() {
protocol GloballyIsolatedProto {
}

// rdar://75849035 - trying to conform an actor to a global-actor isolated protocol should result in an error
// rdar://75849035 - trying to conform an actor to a global-actor-isolated protocol should result in an error
func test_conforming_actor_to_global_actor_protocol() {
@available(SwiftStdlib 5.1, *)
actor MyValue : GloballyIsolatedProto {}
// expected-error@-1 {{actor 'MyValue' cannot conform to global actor isolated protocol 'GloballyIsolatedProto'}}
// expected-error@-1 {{actor 'MyValue' cannot conform to global-actor-isolated protocol 'GloballyIsolatedProto'}}
}

func test_nonisolated_variable() {
Expand Down
4 changes: 2 additions & 2 deletions test/Concurrency/actor_isolation_unsafe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class C7: C2 {
protocol GloballyIsolatedProto {
}

// rdar://75849035 - trying to conform an actor to a global-actor isolated protocol should result in an error
// rdar://75849035 - trying to conform an actor to a global-actor-isolated protocol should result in an error
func test_conforming_actor_to_global_actor_protocol() {
actor MyValue : GloballyIsolatedProto {}
// expected-error@-1 {{actor 'MyValue' cannot conform to global actor isolated protocol 'GloballyIsolatedProto'}}
// expected-error@-1 {{actor 'MyValue' cannot conform to global-actor-isolated protocol 'GloballyIsolatedProto'}}
}
2 changes: 1 addition & 1 deletion test/Concurrency/flow_isolation_nonstrict.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class NonSendableType {
}

// rdar://94699928 - don't emit sendable diagnostics in non-'complete' mode
// for deinits of actor or global-actor isolated types
// for deinits of actor- or global-actor-isolated types

@available(SwiftStdlib 5.1, *)
@MainActor class AwesomeUIView {}
Expand Down
4 changes: 2 additions & 2 deletions test/Concurrency/global_actor_function_types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Emit SIL with targeted concurrency.
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted -verify-additional-prefix without-transferring-

// Emit SIL with strict concurrency + region based isolation + transferring
// Emit SIL with strict concurrency + region-based isolation + transferring
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -verify-additional-prefix complete-tns-

// REQUIRES: concurrency
Expand Down Expand Up @@ -328,7 +328,7 @@ func stripActor(_ expr: @Sendable @autoclosure () -> (() -> ())) async {
}

// We used to not emit an error here with strict-concurrency enabled since we
// were inferring the async let to main actor isolated (which was incorrect). We
// were inferring the async let to MainActor isolated (which was incorrect). We
// now always treat async let as non-isolated, so we get the same error in all
// contexts.
@MainActor func exampleWhereConstraintSolverHasWrongDeclContext_v2() async -> Int {
Expand Down
Loading