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:
Allan Shortlidge
2023-01-31 17:00:18 -08:00
parent df1750d8b7
commit d2524a6de8
20 changed files with 93 additions and 91 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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),