diff --git a/include/swift/AST/Attr.h b/include/swift/AST/Attr.h index 6b55f5e0c93..e8cbb1d015a 100644 --- a/include/swift/AST/Attr.h +++ b/include/swift/AST/Attr.h @@ -2219,15 +2219,12 @@ public: /// The @_backDeploy(...) attribute, used to make function declarations available /// for back deployment to older OSes via emission into the client binary. -class BackDeployAttr: public DeclAttribute { +class BackDeployedAttr : public DeclAttribute { public: - BackDeployAttr(SourceLoc AtLoc, SourceRange Range, - PlatformKind Platform, - const llvm::VersionTuple Version, - bool Implicit) - : DeclAttribute(DAK_BackDeploy, AtLoc, Range, Implicit), - Platform(Platform), - Version(Version) {} + BackDeployedAttr(SourceLoc AtLoc, SourceRange Range, PlatformKind Platform, + const llvm::VersionTuple Version, bool Implicit) + : DeclAttribute(DAK_BackDeployed, AtLoc, Range, Implicit), + Platform(Platform), Version(Version) {} /// The platform the symbol is available for back deployment on. const PlatformKind Platform; @@ -2239,7 +2236,7 @@ public: bool isActivePlatform(const ASTContext &ctx) const; static bool classof(const DeclAttribute *DA) { - return DA->getKind() == DAK_BackDeploy; + return DA->getKind() == DAK_BackDeployed; } }; @@ -2419,9 +2416,9 @@ public: /// otherwise. const AvailableAttr *getNoAsync(const ASTContext &ctx) const; - /// Returns the \c @_backDeploy attribute that is active for the current + /// Returns the `@backDeployed` attribute that is active for the current /// platform. - const BackDeployAttr *getBackDeploy(const ASTContext &ctx) const; + const BackDeployedAttr *getBackDeployed(const ASTContext &ctx) const; SWIFT_DEBUG_DUMPER(dump(const Decl *D = nullptr)); void print(ASTPrinter &Printer, const PrintOptions &Options, diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index be051e2317f..a942b2767a8 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -884,9 +884,9 @@ public: Optional getIntroducedOSVersion(PlatformKind Kind) const; /// Returns the OS version in which the decl became ABI as specified by the - /// @_backDeploy attribute. + /// @backDeployed attribute. Optional - getBackDeployBeforeOSVersion(ASTContext &Ctx) const; + getBackDeployedBeforeOSVersion(ASTContext &Ctx) const; /// Returns the starting location of the entire declaration. SourceLoc getStartLoc() const { return getSourceRange().Start; } @@ -6808,8 +6808,8 @@ public: /// \return the synthesized thunk, or null if the base of the call has /// diagnosed errors during type checking. FuncDecl *getDistributedThunk() const; - - /// Returns 'true' if the function has (or inherits) the @c @_backDeploy + + /// Returns 'true' if the function has (or inherits) the `@backDeployed` /// attribute. bool isBackDeployed() const; diff --git a/include/swift/AST/DiagnosticsParse.def b/include/swift/AST/DiagnosticsParse.def index 345479888da..e9b1c639f32 100644 --- a/include/swift/AST/DiagnosticsParse.def +++ b/include/swift/AST/DiagnosticsParse.def @@ -1593,11 +1593,11 @@ ERROR(originally_defined_in_need_nonempty_module_name,none, // backDeploy ERROR(attr_back_deploy_expected_before_label,none, - "expected 'before:' in '@_backDeploy' attribute", ()) + "expected 'before:' in '@backDeployed' attribute", ()) ERROR(attr_back_deploy_expected_colon_after_before,none, - "expected ':' after 'before' in '@_backDeploy' attribute", ()) + "expected ':' after 'before' in '@backDeployed' attribute", ()) ERROR(attr_back_deploy_missing_rparen,none, - "expected ')' in '@_backDeploy' argument list", ()) + "expected ')' in '@backDeployed' argument list", ()) // convention ERROR(convention_attribute_expected_lparen,none, diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 99185bad96d..f11c131d326 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -6072,7 +6072,7 @@ ERROR(usable_from_inline_attr_in_protocol,none, "an '@_alwaysEmitIntoClient' function|" \ "a default argument value|" \ "a property initializer in a '@frozen' type|" \ - "a '@_backDeploy' function'}" + "a '@backDeployed' function'}" #define DECL_OR_ACCESSOR "%select{%0|%0 for}" diff --git a/include/swift/Parse/Parser.h b/include/swift/Parse/Parser.h index 73da5ba9cbc..fd373f89f27 100644 --- a/include/swift/Parse/Parser.h +++ b/include/swift/Parse/Parser.h @@ -1093,9 +1093,10 @@ public: ParserResult parseTransposeAttribute(SourceLoc AtLoc, SourceLoc Loc); - /// Parse the @_backDeploy attribute. - bool parseBackDeployAttribute(DeclAttributes &Attributes, StringRef AttrName, - SourceLoc AtLoc, SourceLoc Loc); + /// Parse the @backDeployed attribute. + bool parseBackDeployedAttribute(DeclAttributes &Attributes, + StringRef AttrName, SourceLoc AtLoc, + SourceLoc Loc); /// Parse the @_documentation attribute. ParserResult parseDocumentationAttribute(SourceLoc AtLoc, diff --git a/include/swift/SIL/SILDeclRef.h b/include/swift/SIL/SILDeclRef.h index aa1ec5b0e41..18fdd3ef533 100644 --- a/include/swift/SIL/SILDeclRef.h +++ b/include/swift/SIL/SILDeclRef.h @@ -390,7 +390,7 @@ struct SILDeclRef { bool isNoinline() const; /// True if the function has __always inline attribute. bool isAlwaysInline() const; - /// True if the function has the @_backDeploy attribute. + /// True if the function has the @backDeployed attribute. bool isBackDeployed() const; /// Return the expected linkage for a definition of this declaration. diff --git a/lib/AST/Attr.cpp b/lib/AST/Attr.cpp index beac9d172bd..64d0f2def3b 100644 --- a/lib/AST/Attr.cpp +++ b/lib/AST/Attr.cpp @@ -400,23 +400,24 @@ const AvailableAttr *DeclAttributes::getNoAsync(const ASTContext &ctx) const { return bestAttr; } -const BackDeployAttr * -DeclAttributes::getBackDeploy(const ASTContext &ctx) const { - const BackDeployAttr *bestAttr = nullptr; +const BackDeployedAttr * +DeclAttributes::getBackDeployed(const ASTContext &ctx) const { + const BackDeployedAttr *bestAttr = nullptr; for (auto attr : *this) { - auto *backDeployAttr = dyn_cast(attr); - if (!backDeployAttr) + auto *backDeployedAttr = dyn_cast(attr); + if (!backDeployedAttr) continue; - if (backDeployAttr->isInvalid() || !backDeployAttr->isActivePlatform(ctx)) + if (backDeployedAttr->isInvalid() || + !backDeployedAttr->isActivePlatform(ctx)) continue; // We have an attribute that is active for the platform, but // is it more specific than our current best? - if (!bestAttr || inheritsAvailabilityFromPlatform(backDeployAttr->Platform, - bestAttr->Platform)) { - bestAttr = backDeployAttr; + if (!bestAttr || inheritsAvailabilityFromPlatform( + backDeployedAttr->Platform, bestAttr->Platform)) { + bestAttr = backDeployedAttr; } } @@ -547,13 +548,14 @@ static void printShortFormBackDeployed(ArrayRef Attrs, ASTPrinter &Printer, const PrintOptions &Options) { assert(!Attrs.empty()); + // TODO: Print `@backDeployed` in swiftinterfaces (rdar://104920183) Printer << "@_backDeploy(before: "; bool isFirst = true; for (auto *DA : Attrs) { if (!isFirst) Printer << ", "; - auto *attr = cast(DA); + auto *attr = cast(DA); Printer << platformString(attr->Platform) << " " << attr->Version.getAsString(); isFirst = false; @@ -773,7 +775,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options, AttributeVector shortAvailableAttributes; const DeclAttribute *swiftVersionAvailableAttribute = nullptr; const DeclAttribute *packageDescriptionVersionAvailableAttribute = nullptr; - AttributeVector backDeployAttributes; + AttributeVector backDeployedAttributes; AttributeVector longAttributes; AttributeVector attributes; AttributeVector modifiers; @@ -811,7 +813,7 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options, } AttributeVector &which = DA->isDeclModifier() ? modifiers : - isa(DA) ? backDeployAttributes : + isa(DA) ? backDeployedAttributes : isShortAvailable(DA) ? shortAvailableAttributes : DA->isLongAttribute() ? longAttributes : attributes; @@ -824,8 +826,8 @@ void DeclAttributes::print(ASTPrinter &Printer, const PrintOptions &Options, printShortFormAvailable(packageDescriptionVersionAvailableAttribute, Printer, Options); if (!shortAvailableAttributes.empty()) printShortFormAvailable(shortAvailableAttributes, Printer, Options); - if (!backDeployAttributes.empty()) - printShortFormBackDeployed(backDeployAttributes, Printer, Options); + if (!backDeployedAttributes.empty()) + printShortFormBackDeployed(backDeployedAttributes, Printer, Options); for (auto DA : longAttributes) DA->print(Printer, Options, D); @@ -1324,10 +1326,11 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options, break; } - case DAK_BackDeploy: { + case DAK_BackDeployed: { + // TODO: Print `@backDeployed` in swiftinterfaces (rdar://104920183) Printer.printAttrName("@_backDeploy"); Printer << "(before: "; - auto Attr = cast(this); + auto Attr = cast(this); Printer << platformString(Attr->Platform) << " " << Attr->Version.getAsString(); Printer << ")"; @@ -1534,8 +1537,8 @@ StringRef DeclAttribute::getAttrName() const { return "transpose"; case DAK_UnavailableFromAsync: return "_unavailableFromAsync"; - case DAK_BackDeploy: - return "_backDeploy"; + case DAK_BackDeployed: + return "backDeployed"; case DAK_Expose: return "_expose"; case DAK_Documentation: @@ -1791,7 +1794,7 @@ bool AvailableAttr::isActivePlatform(const ASTContext &ctx) const { return isPlatformActive(Platform, ctx.LangOpts); } -bool BackDeployAttr::isActivePlatform(const ASTContext &ctx) const { +bool BackDeployedAttr::isActivePlatform(const ASTContext &ctx) const { return isPlatformActive(Platform, ctx.LangOpts); } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index eafc5704490..ad7a1fb8b2b 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -417,13 +417,13 @@ Decl::getIntroducedOSVersion(PlatformKind Kind) const { } Optional -Decl::getBackDeployBeforeOSVersion(ASTContext &Ctx) const { - if (auto *attr = getAttrs().getBackDeploy(Ctx)) +Decl::getBackDeployedBeforeOSVersion(ASTContext &Ctx) const { + if (auto *attr = getAttrs().getBackDeployed(Ctx)) return attr->Version; - // Accessors may inherit `@_backDeploy`. + // Accessors may inherit `@backDeployed`. if (auto *AD = dyn_cast(this)) - return AD->getStorage()->getBackDeployBeforeOSVersion(Ctx); + return AD->getStorage()->getBackDeployedBeforeOSVersion(Ctx); return None; } @@ -971,8 +971,8 @@ AvailabilityContext Decl::getAvailabilityForLinkage() const { ASTContext &ctx = getASTContext(); // When computing availability for linkage, use the "before" version from - // the @_backDeploy attribute, if present. - if (auto backDeployVersion = getBackDeployBeforeOSVersion(ctx)) + // the @backDeployed attribute, if present. + if (auto backDeployVersion = getBackDeployedBeforeOSVersion(ctx)) return AvailabilityContext{VersionRange::allGTE(*backDeployVersion)}; auto containingContext = @@ -8065,12 +8065,12 @@ bool AbstractFunctionDecl::isSendable() const { } bool AbstractFunctionDecl::isBackDeployed() const { - if (getAttrs().hasAttribute()) + if (getAttrs().hasAttribute()) return true; // Property and subscript accessors inherit the attribute. if (auto *AD = dyn_cast(this)) { - if (AD->getStorage()->getAttrs().hasAttribute()) + if (AD->getStorage()->getAttrs().hasAttribute()) return true; } diff --git a/lib/AST/DeclContext.cpp b/lib/AST/DeclContext.cpp index 6e4ab433efc..483d9a0a4f6 100644 --- a/lib/AST/DeclContext.cpp +++ b/lib/AST/DeclContext.cpp @@ -466,13 +466,13 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator, /*allowUsableFromInline=*/true}; } - if (AFD->getAttrs().hasAttribute()) { + if (AFD->getAttrs().hasAttribute()) { return {FragileFunctionKind::BackDeploy, /*allowUsableFromInline=*/true}; } // Property and subscript accessors inherit @_alwaysEmitIntoClient, - // @_backDeploy, and @inlinable from their storage declarations. + // @backDeployed, and @inlinable from their storage declarations. if (auto accessor = dyn_cast(AFD)) { auto *storage = accessor->getStorage(); if (storage->getAttrs().getAttribute()) { @@ -483,7 +483,7 @@ swift::FragileFunctionKindRequest::evaluate(Evaluator &evaluator, return {FragileFunctionKind::AlwaysEmitIntoClient, /*allowUsableFromInline=*/true}; } - if (storage->getAttrs().hasAttribute()) { + if (storage->getAttrs().hasAttribute()) { return {FragileFunctionKind::BackDeploy, /*allowUsableFromInline=*/true}; } diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 73b23d41843..98dd0ecf90a 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1961,14 +1961,14 @@ ParserStatus Parser::parsePlatformVersionInList(StringRef AttrName, return makeParserSuccess(); } -bool Parser::parseBackDeployAttribute(DeclAttributes &Attributes, - StringRef AttrName, SourceLoc AtLoc, - SourceLoc Loc) { +bool Parser::parseBackDeployedAttribute(DeclAttributes &Attributes, + StringRef AttrName, SourceLoc AtLoc, + SourceLoc Loc) { std::string AtAttrName = (llvm::Twine("@") + AttrName).str(); auto LeftLoc = Tok.getLoc(); if (!consumeIf(tok::l_paren)) { diagnose(Loc, diag::attr_expected_lparen, AtAttrName, - DeclAttribute::isDeclModifier(DAK_BackDeploy)); + DeclAttribute::isDeclModifier(DAK_BackDeployed)); return false; } @@ -2019,9 +2019,9 @@ bool Parser::parseBackDeployAttribute(DeclAttributes &Attributes, assert(!PlatformAndVersions.empty()); auto AttrRange = SourceRange(Loc, Tok.getLoc()); for (auto &Item : PlatformAndVersions) { - Attributes.add(new (Context) - BackDeployAttr(AtLoc, AttrRange, Item.first, Item.second, - /*IsImplicit*/ false)); + Attributes.add(new (Context) BackDeployedAttr(AtLoc, AttrRange, Item.first, + Item.second, + /*IsImplicit*/ false)); } return true; } @@ -3366,8 +3366,8 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc, message, AtLoc, SourceRange(Loc, Tok.getLoc()), false)); break; } - case DAK_BackDeploy: { - if (!parseBackDeployAttribute(Attributes, AttrName, AtLoc, Loc)) + case DAK_BackDeployed: { + if (!parseBackDeployedAttribute(Attributes, AttrName, AtLoc, Loc)) return false; break; } diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index 4632a565653..a158a5e9b42 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -261,7 +261,7 @@ static void convertOwnershipConventionsGivenParamInfos( static bool shouldApplyBackDeploymentThunk(ValueDecl *decl, ASTContext &ctx, ResilienceExpansion expansion) { - auto backDeployBeforeVersion = decl->getBackDeployBeforeOSVersion(ctx); + auto backDeployBeforeVersion = decl->getBackDeployedBeforeOSVersion(ctx); if (!backDeployBeforeVersion) return false; @@ -1139,7 +1139,7 @@ public: return SILDeclRef(distributedThunk).asDistributed(); } - // A call to `@_backDeploy` function may need to go through a thunk. + // A call to `@backDeployed` function may need to go through a thunk. if (shouldApplyBackDeploymentThunk(afd, ctx, SGF.F.getResilienceExpansion())) { return SILDeclRef(afd).asBackDeploymentKind( diff --git a/lib/SILGen/SILGenBackDeploy.cpp b/lib/SILGen/SILGenBackDeploy.cpp index 0f1b99dfcef..6c9b142da66 100644 --- a/lib/SILGen/SILGenBackDeploy.cpp +++ b/lib/SILGen/SILGenBackDeploy.cpp @@ -62,7 +62,7 @@ static void emitBackDeployIfAvailableCondition(SILGenFunction &SGF, SILLocation loc, SILBasicBlock *availableBB, SILBasicBlock *unavailableBB) { - auto version = AFD->getBackDeployBeforeOSVersion(SGF.SGM.getASTContext()); + auto version = AFD->getBackDeployedBeforeOSVersion(SGF.SGM.getASTContext()); VersionRange OSVersion = VersionRange::empty(); if (version.has_value()) { OSVersion = VersionRange::allGTE(*version); diff --git a/lib/SILOptimizer/UtilityPasses/SILSkippingChecker.cpp b/lib/SILOptimizer/UtilityPasses/SILSkippingChecker.cpp index da5d8218cc4..8a58f02fc1e 100644 --- a/lib/SILOptimizer/UtilityPasses/SILSkippingChecker.cpp +++ b/lib/SILOptimizer/UtilityPasses/SILSkippingChecker.cpp @@ -72,7 +72,7 @@ static bool shouldHaveSkippedFunction(const SILFunction &F) { return false; } - // Functions with @_backDeploy may be copied into the client, so they + // Functions with @backDeployed may be copied into the client, so they // shouldn't be skipped. The SILFunction that may be copied into the client // should be serialized and therefore is already handled above. However, a // second resilient SILFunction is also emitted for back deployed functions. diff --git a/lib/Sema/ResilienceDiagnostics.cpp b/lib/Sema/ResilienceDiagnostics.cpp index 2d77de07751..ffe864a066c 100644 --- a/lib/Sema/ResilienceDiagnostics.cpp +++ b/lib/Sema/ResilienceDiagnostics.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// // // This file implements diagnostics for fragile functions, like those with -// @inlinable, @_alwaysEmitIntoClient, or @_backDeploy. +// @inlinable, @_alwaysEmitIntoClient, or @backDeployed. // //===----------------------------------------------------------------------===// diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index d75408cf596..974f88eea13 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -158,7 +158,7 @@ public: IGNORED_ATTR(InheritActorContext) IGNORED_ATTR(Isolated) IGNORED_ATTR(Preconcurrency) - IGNORED_ATTR(BackDeploy) + IGNORED_ATTR(BackDeployed) IGNORED_ATTR(Documentation) IGNORED_ATTR(MacroRole) #undef IGNORED_ATTR @@ -334,7 +334,7 @@ public: void visitCompilerInitializedAttr(CompilerInitializedAttr *attr); void checkAvailableAttrs(ArrayRef Attrs); - void checkBackDeployAttrs(ArrayRef Attrs); + void checkBackDeployedAttrs(ArrayRef Attrs); void visitKnownToBeLocalAttr(KnownToBeLocalAttr *attr); @@ -1493,10 +1493,10 @@ void TypeChecker::checkDeclAttributes(Decl *D) { AttributeChecker Checker(D); // We need to check all availableAttrs, OriginallyDefinedInAttr and - // BackDeployAttr relative to each other, so collect them and check in + // BackDeployedAttr relative to each other, so collect them and check in // batch later. llvm::SmallVector availableAttrs; - llvm::SmallVector backDeployAttrs; + llvm::SmallVector backDeployedAttrs; llvm::SmallVector ODIAttrs; for (auto attr : D->getAttrs()) { if (!attr->isValid()) continue; @@ -1506,8 +1506,8 @@ void TypeChecker::checkDeclAttributes(Decl *D) { if (attr->canAppearOnDecl(D)) { if (auto *ODI = dyn_cast(attr)) { ODIAttrs.push_back(ODI); - } else if (auto *BD = dyn_cast(attr)) { - backDeployAttrs.push_back(BD); + } else if (auto *BD = dyn_cast(attr)) { + backDeployedAttrs.push_back(BD); } else { // check @available attribute both collectively and individually. if (auto *AV = dyn_cast(attr)) { @@ -1553,7 +1553,7 @@ void TypeChecker::checkDeclAttributes(Decl *D) { Checker.diagnoseAndRemoveAttr(attr, diag::invalid_decl_attribute, attr); } Checker.checkAvailableAttrs(availableAttrs); - Checker.checkBackDeployAttrs(backDeployAttrs); + Checker.checkBackDeployedAttrs(backDeployedAttrs); Checker.checkOriginalDefinedInAttrs(ODIAttrs); } @@ -4553,7 +4553,8 @@ void AttributeChecker::checkAvailableAttrs(ArrayRef Attrs) { } } -void AttributeChecker::checkBackDeployAttrs(ArrayRef Attrs) { +void AttributeChecker::checkBackDeployedAttrs( + ArrayRef Attrs) { if (Attrs.empty()) return; @@ -4577,7 +4578,7 @@ void AttributeChecker::checkBackDeployAttrs(ArrayRef Attrs) { auto *VD = cast(D); std::map seenPlatforms; - auto *ActiveAttr = D->getAttrs().getBackDeploy(Ctx); + auto *ActiveAttr = D->getAttrs().getBackDeployed(Ctx); for (auto *Attr : Attrs) { // Back deployment only makes sense for public declarations. diff --git a/lib/Sema/TypeCheckDeclOverride.cpp b/lib/Sema/TypeCheckDeclOverride.cpp index f68aaaa3bc9..1d4c4eff520 100644 --- a/lib/Sema/TypeCheckDeclOverride.cpp +++ b/lib/Sema/TypeCheckDeclOverride.cpp @@ -1614,7 +1614,7 @@ namespace { UNINTERESTING_ATTR(NoMetadata) UNINTERESTING_ATTR(CompileTimeConst) - UNINTERESTING_ATTR(BackDeploy) + UNINTERESTING_ATTR(BackDeployed) UNINTERESTING_ATTR(KnownToBeLocal) UNINTERESTING_ATTR(UnsafeInheritExecutor) diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 2db0bdd53e6..0bf5afb52c6 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -5380,18 +5380,17 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() { break; } - case decls_block::BackDeploy_DECL_ATTR: { + case decls_block::BackDeployed_DECL_ATTR: { bool isImplicit; unsigned Platform; DEF_VER_TUPLE_PIECES(Version); - serialization::decls_block::BackDeployDeclAttrLayout::readRecord( + serialization::decls_block::BackDeployedDeclAttrLayout::readRecord( scratch, isImplicit, LIST_VER_TUPLE_PIECES(Version), Platform); llvm::VersionTuple Version; DECODE_VER_TUPLE(Version) - Attr = new (ctx) BackDeployAttr(SourceLoc(), SourceRange(), - (PlatformKind)Platform, - Version, - isImplicit); + Attr = new (ctx) + BackDeployedAttr(SourceLoc(), SourceRange(), (PlatformKind)Platform, + Version, isImplicit); break; } diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index dec584c12c5..757299e267e 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -2214,8 +2214,8 @@ namespace decls_block { BCBlob // Message >; - using BackDeployDeclAttrLayout = BCRecordLayout< - BackDeploy_DECL_ATTR, + using BackDeployedDeclAttrLayout = BCRecordLayout< + BackDeployed_DECL_ATTR, BCFixed<1>, // implicit flag BC_AVAIL_TUPLE, // OS version BCVBR<5> // platform diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 7dcf4867bd2..e64c240867b 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -2737,11 +2737,11 @@ class Serializer::DeclSerializer : public DeclVisitor { return; } - case DAK_BackDeploy: { - auto *theAttr = cast(DA); + case DAK_BackDeployed: { + auto *theAttr = cast(DA); ENCODE_VER_TUPLE(Version, llvm::Optional(theAttr->Version)); - auto abbrCode = S.DeclTypeAbbrCodes[BackDeployDeclAttrLayout::Code]; - BackDeployDeclAttrLayout::emitRecord( + auto abbrCode = S.DeclTypeAbbrCodes[BackDeployedDeclAttrLayout::Code]; + BackDeployedDeclAttrLayout::emitRecord( S.Out, S.ScratchRecord, abbrCode, theAttr->isImplicit(), LIST_VER_TUPLE_PIECES(Version), diff --git a/utils/gyb_syntax_support/AttributeKinds.py b/utils/gyb_syntax_support/AttributeKinds.py index 1b6ef994f97..c40d35e6ded 100644 --- a/utils/gyb_syntax_support/AttributeKinds.py +++ b/utils/gyb_syntax_support/AttributeKinds.py @@ -669,11 +669,12 @@ DECL_ATTR_KINDS = [ ABIStableToAdd, ABIStableToRemove, APIStableToAdd, APIStableToRemove, code=128), - DeclAttribute('_backDeploy', 'BackDeploy', + DeclAttribute('backDeployed', 'BackDeployed', OnAbstractFunction, OnAccessor, OnSubscript, OnVar, - AllowMultipleAttributes, LongAttribute, UserInaccessible, + AllowMultipleAttributes, LongAttribute, ABIStableToAdd, ABIStableToRemove, APIStableToAdd, APIBreakingToRemove, # noqa: E501 code=129), + DeclAttributeAlias('_backDeploy', 'BackDeployed'), SimpleDeclAttribute('_moveOnly', 'MoveOnly', OnNominalType,