[ObjC] Implement @available in the Parser and AST
authorErik Pilkington <erik.pilkington@gmail.com>
Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)
commitd3b0a63ca6016aceefdc147eeb88e90a988dacca
tree2576c0af7b32df8726bede4d459e7b275416754e
parentc45b5c87351f6fd018c60eb4839db3a12f289179
[ObjC] Implement @available in the Parser and AST

This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

Differential Revision: https://reviews.llvm.org/D22171

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275654 91177308-0d34-0410-b5e6-96231b3b80d8
30 files changed:
include/clang-c/Index.h
include/clang/AST/Availability.h [new file with mode: 0644]
include/clang/AST/ExprObjC.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/StmtNodes.td
include/clang/Basic/TokenKinds.def
include/clang/Parse/Parser.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
lib/AST/Expr.cpp
lib/AST/ExprClassification.cpp
lib/AST/ExprConstant.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/StmtPrinter.cpp
lib/AST/StmtProfile.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseExpr.cpp
lib/Parse/ParseObjc.cpp
lib/Sema/SemaExceptionSpec.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Parser/objc-available.m [new file with mode: 0644]
tools/libclang/CIndex.cpp
tools/libclang/CXCursor.cpp