diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-26 03:35:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-26 03:35:55 +0000 |
commit | b53e417ba487f4193ef3b0485b420e0fdae643a2 (patch) | |
tree | 14884ffa641989b6851088b555f1dd03b42331b4 /lib/AST/DeclBase.cpp | |
parent | 2234873111009eb8655d63362cedc422eb9fc517 (diff) |
Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 0e871ecc4c..c081b0d4a9 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -268,6 +268,17 @@ static AvailabilityResult CheckAvailability(ASTContext &Context, if (A->getPlatform()->getName() != TargetPlatform) return AR_Available; + // Make sure that this declaration has not been marked 'unavailable'. + if (A->getUnavailable()) { + if (Message) { + Message->clear(); + llvm::raw_string_ostream Out(*Message); + Out << "not available on " << PrettyPlatformName; + } + + return AR_Unavailable; + } + // Make sure that this declaration has already been introduced. if (!A->getIntroduced().empty() && TargetMinVersion < A->getIntroduced()) { |