Add an OS version check for API availability to standard library and runtime.
This patch adds a compiler entry point to the standard library that checks
whether the running OS version is greater than or equal to a given version
triple. The idea is that #os(...) will get SILGen'd into a call to this
function.
The standard library function calls a runtime function to actually get the OS
version. This runtime function uses -[NSProcessInfo operatingSystemVersion] when
possible, otherwise it loads the SystemVersion plist. When running under the
simulator, we use an environmental variable set by the simulator to look up the
version for the simulated OS and not the host OS.
At the moment, there is no caching for version info. I will add this in a later
patch.
Swift SVN r22303
5 files changed