Add 'nopartial' qualifier for availability attributes.
authorManman Ren <manman.ren@gmail.com>
Wed, 17 Feb 2016 22:05:48 +0000 (22:05 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 17 Feb 2016 22:05:48 +0000 (22:05 +0000)
commitb636b904c229f02d574a27b3f6f2a41c39a1d541
tree146892ac295d3d9d8b8809e2c23253d3452e25d7
parent4083e038e918ccc1a5800f424c3e814bdd425e79
Add 'nopartial' qualifier for availability attributes.

An optional nopartial can be placed after the platform name.
int bar() __attribute__((availability(macosx,nopartial,introduced=10.12))

When deploying back to a platform version prior to when the declaration was
introduced, with 'nopartial', Clang emits an error specifying that the function
is not introduced yet; without 'nopartial', the behavior stays the same: the
declaration is `weakly linked`.

A member is added to the end of AttributeList to save the location of the
'nopartial' keyword. A bool member is added to AvailabilityAttr.

The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as
we handle unavailable cases.

Reviewed by Doug Gregor and Jordan Rose.

rdar://23791325

llvm-svn: 261163
15 files changed:
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/AttributeList.h
clang/include/clang/Sema/DelayedDiagnostic.h
clang/include/clang/Sema/Sema.h
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/DelayedDiagnostic.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/attr-availability-macosx.c