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 r27355
This commit is contained in:
Doug Gregor
2015-04-16 06:36:45 +00:00
parent 707394aea8
commit 4e0e32197f
15 changed files with 279 additions and 105 deletions

View File

@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
/// To ensure that two separate changes don't silently get merged into one
/// in source control, you should also update the comment to briefly
/// describe what change you made.
const uint16_t VERSION_MINOR = 192; // Last change: include the type decl for type witnesses
const uint16_t VERSION_MINOR = 193; // Last change: deprecated attribute
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -1263,6 +1263,7 @@ namespace decls_block {
Availability_DECL_ATTR,
BCFixed<1>, // implicit flag
BCFixed<1>, // is unconditionally unavailable?
BCFixed<1>, // is unconditionally deprecated?
BC_AVAIL_TUPLE, // Introduced
BC_AVAIL_TUPLE, // Deprecated
BC_AVAIL_TUPLE, // Obsoleted