summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-06-28 20:55:30 +0000
committerManman Ren <manman.ren@gmail.com>2016-06-28 20:55:30 +0000
commitccf25bbf3fdf2905bba9a3b199d5367e9c88db43 (patch)
treea8870395a55c30b88629abfdb4acaba8baeb4982 /clang/lib/Parse/ParseDecl.cpp
parent4a93c59e7f30fb8a76a4ded8d2329c4a4da3974f (diff)
downloadbcm5719-llvm-ccf25bbf3fdf2905bba9a3b199d5367e9c88db43.tar.gz
bcm5719-llvm-ccf25bbf3fdf2905bba9a3b199d5367e9c88db43.zip
AvailabilityAttr: we accept "macos" as the platform name.
We continue accepting "macosx" but canonicalize it to "macos", When emitting diagnostics, we use "macOS" instead of "OS X". The PlatformName in TargetInfo is changed from "macosx" to "macos" so we can directly compare the Platform in AvailabilityAttr with the PlatformName in TargetInfo. rdar://26795172 rdar://26800775 llvm-svn: 274064
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index be694901b91..b7a253156f2 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -880,6 +880,13 @@ void Parser::ParseAvailabilityAttribute(IdentifierInfo &Availability,
return;
}
IdentifierLoc *Platform = ParseIdentifierLoc();
+ // Canonicalize platform name from "macosx" to "macos".
+ if (Platform->Ident && Platform->Ident->getName() == "macosx")
+ Platform->Ident = PP.getIdentifierInfo("macos");
+ // Canonicalize platform name from "macosx_app_extension" to
+ // "macos_app_extension".
+ if (Platform->Ident && Platform->Ident->getName() == "macosx_app_extension")
+ Platform->Ident = PP.getIdentifierInfo("macos_app_extension");
// Parse the ',' following the platform name.
if (ExpectAndConsume(tok::comma)) {
OpenPOWER on IntegriCloud