diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-05-09 15:34:46 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-05-09 15:34:46 +0000 |
commit | 919b7c6542627389098e7adc5aed9bedf1438d3c (patch) | |
tree | e132830455b28fc760c9b73141aff0e3a996e947 /lib/Parse/ParseExpr.cpp | |
parent | e503002a06e7f271d59aef44079d55eedb7df7cf (diff) |
Add support for pretty platform names to `@available`/
`__builtin_available`
This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in
`@available`/`__builtin_available`.
rdar://32067795
Differential Revision: https://reviews.llvm.org/D33000
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 3e02e46ddc..77316b9ad1 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -3001,12 +3001,14 @@ Optional<AvailabilitySpec> Parser::ParseAvailabilitySpec() { if (Version.empty()) return None; - StringRef Platform = PlatformIdentifier->Ident->getName(); + StringRef GivenPlatform = PlatformIdentifier->Ident->getName(); + StringRef Platform = + AvailabilityAttr::canonicalizePlatformName(GivenPlatform); if (AvailabilityAttr::getPrettyPlatformName(Platform).empty()) { Diag(PlatformIdentifier->Loc, diag::err_avail_query_unrecognized_platform_name) - << Platform; + << GivenPlatform; return None; } |