frontend: add basic support for @_spi_available

This commit is contained in:
Xi Ge
2022-03-04 16:07:32 -08:00
parent 91410d885e
commit ce07ce2dbc
12 changed files with 60 additions and 30 deletions

View File

@@ -4362,6 +4362,7 @@ DeclDeserializer::readAvailable_DECL_ATTR(SmallVectorImpl<uint64_t> &scratch,
bool isUnavailable;
bool isDeprecated;
bool isPackageDescriptionVersionSpecific;
bool isSPI;
DEF_VER_TUPLE_PIECES(Introduced);
DEF_VER_TUPLE_PIECES(Deprecated);
DEF_VER_TUPLE_PIECES(Obsoleted);
@@ -4371,7 +4372,7 @@ DeclDeserializer::readAvailable_DECL_ATTR(SmallVectorImpl<uint64_t> &scratch,
// Decode the record, pulling the version tuple information.
serialization::decls_block::AvailableDeclAttrLayout::readRecord(
scratch, isImplicit, isUnavailable, isDeprecated,
isPackageDescriptionVersionSpecific, LIST_VER_TUPLE_PIECES(Introduced),
isPackageDescriptionVersionSpecific, isSPI, LIST_VER_TUPLE_PIECES(Introduced),
LIST_VER_TUPLE_PIECES(Deprecated), LIST_VER_TUPLE_PIECES(Obsoleted),
platform, renameDeclID, messageSize, renameSize);
@@ -4406,7 +4407,7 @@ DeclDeserializer::readAvailable_DECL_ATTR(SmallVectorImpl<uint64_t> &scratch,
auto attr = new (ctx) AvailableAttr(
SourceLoc(), SourceRange(), (PlatformKind)platform, message, rename,
renameDecl, Introduced, SourceRange(), Deprecated, SourceRange(),
Obsoleted, SourceRange(), platformAgnostic, isImplicit);
Obsoleted, SourceRange(), platformAgnostic, isImplicit, isSPI);
return attr;
}