]> granicus.if.org Git - clang/commit
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)
commit83a9e40e5fc11754246f14b6628889694d078e07
tree3bfa87543c52eb46a2e6892d2f488fd7289eced6
parentaebd76a8c8b4f5ff463ce508375c3769f1893d1e
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261163 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Parse/Parser.h
include/clang/Sema/AttributeList.h
include/clang/Sema/DelayedDiagnostic.h
include/clang/Sema/Sema.h
lib/Parse/ParseDecl.cpp
lib/Parse/Parser.cpp
lib/Sema/DelayedDiagnostic.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp
test/Sema/attr-availability-macosx.c