mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Implement parsing support for the accepted spelling of @backDeployed for SE-0376.
For source compatibility `@_backDeploy` continues to be accepted as a spelling. rdar://102792909
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2737,11 +2737,11 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_BackDeploy: {
|
||||
auto *theAttr = cast<BackDeployAttr>(DA);
|
||||
case DAK_BackDeployed: {
|
||||
auto *theAttr = cast<BackDeployedAttr>(DA);
|
||||
ENCODE_VER_TUPLE(Version, llvm::Optional<llvm::VersionTuple>(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),
|
||||
|
||||
Reference in New Issue
Block a user