This patch is the first of the feature I proposed on Monday here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html
This patch adds a new AST node, ObjCAvailabilityCheckExpr, and teaches the parser and Sema to build it. Currently, if compiled without -fsyntax-only, Clang errors out in CodeGen. Up next is a patch that implements the availability violation warning itself, then CodeGen support.
ObjCAvailabilityCheckExpr is an predicate expression that will end up compiling into a runtime check of the host's OS version. It can be spelled in two ways:
@available(macos 10.10, *); // Objective-C only __builtin_available(macos 10.10, *); // C, C++, and Objective-C
It's main purpose in life is to guard calls to API calls that are marked with an __attribute__((availability())) greater than the current deployment target, so users can safely use new APIs while still supporting old OS versions.
Thanks!