Skip to content

Commit d430b3e

Browse files
authored
Merge pull request #41022 from DougGregor/preconcurrency-attr-5.6
Rename @_predatesConcurrency to @preconcurrency.
2 parents 5a2df1c + f1a7738 commit d430b3e

31 files changed

+120
-105
lines changed

include/swift/AST/ASTMangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ASTMangler : public Mangler {
7070
/// Whether the mangling predates concurrency, and therefore shouldn't
7171
/// include concurrency features such as global actors or @Sendable
7272
/// function types.
73-
bool PredatesConcurrency = false;
73+
bool Preconcurrency = false;
7474

7575
public:
7676
using SymbolicReferent = llvm::PointerUnion<const NominalTypeDecl *,

include/swift/AST/Attr.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,9 @@ SIMPLE_DECL_ATTR(_noAllocation, NoAllocation,
688688
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
689689
124)
690690

691-
SIMPLE_DECL_ATTR(_predatesConcurrency, PredatesConcurrency,
691+
SIMPLE_DECL_ATTR(preconcurrency, Preconcurrency,
692692
OnFunc | OnConstructor | OnProtocol | OnGenericType | OnVar | OnSubscript |
693-
OnEnumElement | OnImport | UserInaccessible |
693+
OnEnumElement | OnImport |
694694
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
695695
125)
696696

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
896896
void setHoisted(bool hoisted = true) { Bits.Decl.Hoisted = hoisted; }
897897

898898
/// Whether this declaration predates the introduction of concurrency.
899-
bool predatesConcurrency() const;
899+
bool preconcurrency() const;
900900

901901
public:
902902
bool escapedFromIfConfig() const {

include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ ERROR(sil_inst_autodiff_invalid_witness_generic_signature,PointsToFirstBadToken,
17321732
(StringRef, StringRef))
17331733

17341734
WARNING(warn_attr_unsafe_removed,none,
1735-
"'%0' attribute has been removed in favor of @_predatesConcurrency",
1735+
"'%0' attribute has been removed in favor of @preconcurrency",
17361736
(StringRef))
17371737

17381738
//------------------------------------------------------------------------------

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,11 +1953,11 @@ NOTE(add_nominal_sendable_conformance,none,
19531953
"consider making %0 %1 conform to the 'Sendable' protocol",
19541954
(DescriptiveDeclKind, DeclName))
19551955
REMARK(add_predates_concurrency_import,none,
1956-
"add '@_predatesConcurrency' to %select{suppress|treat}0 "
1956+
"add '@preconcurrency' to %select{suppress|treat}0 "
19571957
"'Sendable'-related %select{warnings|errors}0 from module %1"
19581958
"%select{| as warnings}0", (bool, Identifier))
19591959
REMARK(remove_predates_concurrency_import,none,
1960-
"'@_predatesConcurrency' attribute on module %0 is unused", (Identifier))
1960+
"'@preconcurrency' attribute on module %0 is unused", (Identifier))
19611961
WARNING(public_decl_needs_sendable,none,
19621962
"public %0 %1 does not specify whether it is 'Sendable' or not",
19631963
(DescriptiveDeclKind, DeclName))

include/swift/AST/Import.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ enum class ImportFlags {
8282

8383
/// The module is imported assuming that the module itself predates
8484
/// concurrency.
85-
PredatesConcurrency = 0x20,
85+
Preconcurrency = 0x20,
8686

8787
/// Used for DenseMap.
8888
Reserved = 0x80
@@ -550,17 +550,17 @@ struct AttributedImport {
550550
/// Names of explicitly imported SPI groups.
551551
ArrayRef<Identifier> spiGroups;
552552

553-
/// When the import declaration has a `@_predatesConcurrency` annotation, this
553+
/// When the import declaration has a `@preconcurrency` annotation, this
554554
/// is the source range covering the annotation.
555-
SourceRange predatesConcurrencyRange;
555+
SourceRange preconcurrencyRange;
556556

557557
AttributedImport(ModuleInfo module, SourceLoc importLoc = SourceLoc(),
558558
ImportOptions options = ImportOptions(),
559559
StringRef filename = {}, ArrayRef<Identifier> spiGroups = {},
560-
SourceRange predatesConcurrencyRange = {})
560+
SourceRange preconcurrencyRange = {})
561561
: module(module), importLoc(importLoc), options(options),
562562
sourceFileArg(filename), spiGroups(spiGroups),
563-
predatesConcurrencyRange(predatesConcurrencyRange) {
563+
preconcurrencyRange(preconcurrencyRange) {
564564
assert(!(options.contains(ImportFlags::Exported) &&
565565
options.contains(ImportFlags::ImplementationOnly)) ||
566566
options.contains(ImportFlags::Reserved));
@@ -570,7 +570,7 @@ struct AttributedImport {
570570
AttributedImport(ModuleInfo module, AttributedImport<OtherModuleInfo> other)
571571
: AttributedImport(module, other.importLoc, other.options,
572572
other.sourceFileArg, other.spiGroups,
573-
other.predatesConcurrencyRange) { }
573+
other.preconcurrencyRange) { }
574574

575575
friend bool operator==(const AttributedImport<ModuleInfo> &lhs,
576576
const AttributedImport<ModuleInfo> &rhs) {

include/swift/AST/SourceFile.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class SourceFile final : public FileUnit {
8484
/// This is \c None until it is filled in by the import resolution phase.
8585
Optional<ArrayRef<AttributedImport<ImportedModule>>> Imports;
8686

87-
/// Which imports have made use of @_predatesConcurrency.
87+
/// Which imports have made use of @preconcurrency.
8888
llvm::SmallDenseSet<AttributedImport<ImportedModule>>
89-
PredatesConcurrencyImportsUsed;
89+
PreconcurrencyImportsUsed;
9090

9191
/// A unique identifier representing this file; used to mark private decls
9292
/// within the file to keep them from conflicting with other files in the
@@ -297,12 +297,12 @@ class SourceFile final : public FileUnit {
297297
/// resolution.
298298
void setImports(ArrayRef<AttributedImport<ImportedModule>> imports);
299299

300-
/// Whether the given import has used @_predatesConcurrency.
301-
bool hasImportUsedPredatesConcurrency(
300+
/// Whether the given import has used @preconcurrency.
301+
bool hasImportUsedPreconcurrency(
302302
AttributedImport<ImportedModule> import) const;
303303

304-
/// Note that the given import has used @_predatesConcurrency/
305-
void setImportUsedPredatesConcurrency(
304+
/// Note that the given import has used @preconcurrency/
305+
void setImportUsedPreconcurrency(
306306
AttributedImport<ImportedModule> import);
307307

308308
enum ImportQueryKind {

lib/AST/ASTMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ CanType ASTMangler::getDeclTypeForMangling(
29822982
// If this declaration predates concurrency, adjust its type to not
29832983
// contain type features that were not available pre-concurrency. This
29842984
// cannot alter the ABI in any way.
2985-
if (decl->predatesConcurrency()) {
2985+
if (decl->preconcurrency()) {
29862986
ty = ty->stripConcurrency(/*recurse=*/true, /*dropGlobalActor=*/true);
29872987
}
29882988

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ Optional<CustomAttrNominalPair> Decl::getGlobalActorAttr() const {
725725
None);
726726
}
727727

728-
bool Decl::predatesConcurrency() const {
729-
if (getAttrs().hasAttribute<PredatesConcurrencyAttr>())
728+
bool Decl::preconcurrency() const {
729+
if (getAttrs().hasAttribute<PreconcurrencyAttr>())
730730
return true;
731731

732732
// Imported C declarations always predate concurrency.

lib/AST/Module.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,14 +2245,14 @@ SourceFile::setImports(ArrayRef<AttributedImport<ImportedModule>> imports) {
22452245
Imports = getASTContext().AllocateCopy(imports);
22462246
}
22472247

2248-
bool SourceFile::hasImportUsedPredatesConcurrency(
2248+
bool SourceFile::hasImportUsedPreconcurrency(
22492249
AttributedImport<ImportedModule> import) const {
2250-
return PredatesConcurrencyImportsUsed.count(import) != 0;
2250+
return PreconcurrencyImportsUsed.count(import) != 0;
22512251
}
22522252

2253-
void SourceFile::setImportUsedPredatesConcurrency(
2253+
void SourceFile::setImportUsedPreconcurrency(
22542254
AttributedImport<ImportedModule> import) {
2255-
PredatesConcurrencyImportsUsed.insert(import);
2255+
PreconcurrencyImportsUsed.insert(import);
22562256
}
22572257

22582258
bool HasImplementationOnlyImportsRequest::evaluate(Evaluator &evaluator,

0 commit comments

Comments
 (0)