This does several different things to improve how platforms are described in availability diagnostics:
• Mentions the platform in diagnostics for platform-specific @available(unavailable) attributes.
• Replaces “OS X” with “macOS”.
• Replaces “fooOS application extension” with “application extensions for fooOS”.
• Replaces “on fooOS” with “in fooOS”.
Fixes <rdar://problem/49963341>.
Specifically, this is about the /version/ of the running OS.
Previously, this was only autodetected for the interpreter, with the
compiler defaulting to the earliest version of macOS supported by
Swift (10.9); picking the current running OS seems more useful. LLVM
changed their default behavior recently, so this doesn't actually
require any implementation changes.
This only affects macOS today, because it only affects compiling
without an explicit target (i.e. not cross-compiling) on an OS with
cross-version binary compatibility (i.e. not Linux).
rdar://problem/29948658
LLVM r307372 makes it so that the current running macOS version is
always chosen as the default target. It's unclear whether that's the
behavior we want or not; deciding that is tracked by
rdar://problem/29948658. For now, just disable that part of the test.
This allows script mode to pick up the current version of macOS
instead of defaulting to 10.9, making it unnecessary to write #available.
A -target flag can still override this if you're trying to write a
portable script.
The logic is a little tortured to avoid having to actually link to
Foundation.framework or libobjc.
Finishes rdar://problem/29433205.