This patch refactors the target selection in Darwin's driver.
Firstly, the simulator variant of Darwin's platforms is removed in favor of a new environment field.
Secondly, the code that selects the platform and the version is split into 4 different functions instead of being all in one function.
This is an NFC patch, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment.
This patch is a preparation for making -target the canonical way of specifying the platform. This will be done in a follow-up patch https://reviews.llvm.org/D40998.
It would be nice to have a static_assert that EnvVars has the right number of elements. Perhaps something like this would work: