Extend 'availability' attribute with an unconditional 'deprecated' option.

Allow an unversioned 'deprecated' attribute to specify unconditional
deprecation of an API, e.g.,

  @availability(*, deprecated, message="sorry")
  func foo() { }

Also support platform-specific deprecation, e.g.,

  @availability(iOS, deprecated, message="don't use this on iOS")
  func bar() { }

Addresses rdar://problem/20562871.

Swift SVN r27339
This commit is contained in:
Doug Gregor
2015-04-15 23:59:20 +00:00
parent 2b93411ba7
commit b4b5dbb5d8
15 changed files with 266 additions and 100 deletions

View File

@@ -1590,6 +1590,7 @@ void Serializer::writeDeclAttribute(const DeclAttribute *DA) {
Out, ScratchRecord, abbrCode,
theAttr->isImplicit(),
theAttr->isUnconditionallyUnavailable(),
theAttr->isUnconditionallyDeprecated(),
LIST_VER_TUPLE_PIECES(Introduced),
LIST_VER_TUPLE_PIECES(Deprecated),
LIST_VER_TUPLE_PIECES(Obsoleted),