diff options
author | Alex Lorenz <arphaman@gmail.com> | 2018-05-03 01:12:06 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2018-05-03 01:12:06 +0000 |
commit | f4d4cfbefa4c1e61a69f47ac41790cd15a65fb07 (patch) | |
tree | b38163d45f8f9547286ba83eb9a8534f343c62fb /clang/lib/AST/DeclBase.cpp | |
parent | 61ffbf21cdc92e1acc4794b75ea0c12e2caa9414 (diff) | |
download | bcm5719-llvm-f4d4cfbefa4c1e61a69f47ac41790cd15a65fb07.tar.gz bcm5719-llvm-f4d4cfbefa4c1e61a69f47ac41790cd15a65fb07.zip |
[ObjC] Supress the 'implementing unavailable method' warning when
the method declaration is unavailable for an app extension platform
Rationale:
Classes are often shared between an app extension code and
non-app extension code. There's no way to remove the implementation
using preprocessor when building the app extension, so we should not warn here.
rdar://38150617
llvm-svn: 331421
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index baf83a393c0..8d7291ee3ef 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -590,9 +590,11 @@ static AvailabilityResult CheckAvailability(ASTContext &Context, } AvailabilityResult Decl::getAvailability(std::string *Message, - VersionTuple EnclosingVersion) const { + VersionTuple EnclosingVersion, + StringRef *RealizedPlatform) const { if (auto *FTD = dyn_cast<FunctionTemplateDecl>(this)) - return FTD->getTemplatedDecl()->getAvailability(Message, EnclosingVersion); + return FTD->getTemplatedDecl()->getAvailability(Message, EnclosingVersion, + RealizedPlatform); AvailabilityResult Result = AR_Available; std::string ResultMessage; @@ -619,8 +621,11 @@ AvailabilityResult Decl::getAvailability(std::string *Message, AvailabilityResult AR = CheckAvailability(getASTContext(), Availability, Message, EnclosingVersion); - if (AR == AR_Unavailable) + if (AR == AR_Unavailable) { + if (RealizedPlatform) + *RealizedPlatform = Availability->getPlatform()->getName(); return AR_Unavailable; + } if (AR > Result) { Result = AR; |