diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2014-10-10 23:10:10 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2014-10-10 23:10:10 +0000 |
| commit | 7f294b54b382718e9ca31dce602838f8072bc1e3 (patch) | |
| tree | 9cea3183d0516141d5634af653f1797147b9c8ac /clang/lib | |
| parent | aff1b357b0dd8a4035b87ca45df510db0dc9f4ae (diff) | |
| download | bcm5719-llvm-7f294b54b382718e9ca31dce602838f8072bc1e3.tar.gz bcm5719-llvm-7f294b54b382718e9ca31dce602838f8072bc1e3.zip | |
Treat -mios-simulator-version-min option as an alias for -mios-version-min.
We can safely rely on the architecture to distinguish iOS device builds from
iOS simulator builds. We already have code to do that, in fact. This simplifies
some of the error checking for the option handling.
llvm-svn: 219545
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index cbb06c61caf..38cf20305e6 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -456,20 +456,13 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { Arg *OSXVersion = Args.getLastArg(options::OPT_mmacosx_version_min_EQ); Arg *iOSVersion = Args.getLastArg(options::OPT_miphoneos_version_min_EQ); - Arg *iOSSimVersion = Args.getLastArg( - options::OPT_mios_simulator_version_min_EQ); - if (OSXVersion && (iOSVersion || iOSSimVersion)) { + if (OSXVersion && iOSVersion) { getDriver().Diag(diag::err_drv_argument_not_allowed_with) << OSXVersion->getAsString(Args) - << (iOSVersion ? iOSVersion : iOSSimVersion)->getAsString(Args); - iOSVersion = iOSSimVersion = nullptr; - } else if (iOSVersion && iOSSimVersion) { - getDriver().Diag(diag::err_drv_argument_not_allowed_with) - << iOSVersion->getAsString(Args) - << iOSSimVersion->getAsString(Args); - iOSSimVersion = nullptr; - } else if (!OSXVersion && !iOSVersion && !iOSSimVersion) { + << iOSVersion->getAsString(Args); + iOSVersion = nullptr; + } else if (!OSXVersion && !iOSVersion) { // If no deployment target was specified on the command line, check for // environment defines. StringRef OSXTarget; @@ -533,43 +526,30 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { Platform = MacOS; else if (iOSVersion) Platform = IPhoneOS; - else if (iOSSimVersion) - Platform = IPhoneOSSimulator; else llvm_unreachable("Unable to infer Darwin variant"); - // Reject invalid architecture combinations. - if (iOSSimVersion && (getTriple().getArch() != llvm::Triple::x86 && - getTriple().getArch() != llvm::Triple::x86_64)) { - getDriver().Diag(diag::err_drv_invalid_arch_for_deployment_target) - << getTriple().getArchName() << iOSSimVersion->getAsString(Args); - } - // Set the tool chain target information. unsigned Major, Minor, Micro; bool HadExtra; if (Platform == MacOS) { - assert((!iOSVersion && !iOSSimVersion) && "Unknown target platform!"); + assert(!iOSVersion && "Unknown target platform!"); if (!Driver::GetReleaseVersion(OSXVersion->getValue(), Major, Minor, Micro, HadExtra) || HadExtra || Major != 10 || Minor >= 100 || Micro >= 100) getDriver().Diag(diag::err_drv_invalid_version_number) << OSXVersion->getAsString(Args); - } else if (Platform == IPhoneOS || Platform == IPhoneOSSimulator) { - const Arg *Version = iOSVersion ? iOSVersion : iOSSimVersion; - assert(Version && "Unknown target platform!"); - if (!Driver::GetReleaseVersion(Version->getValue(), Major, Minor, + } else if (Platform == IPhoneOS) { + assert(iOSVersion && "Unknown target platform!"); + if (!Driver::GetReleaseVersion(iOSVersion->getValue(), Major, Minor, Micro, HadExtra) || HadExtra || Major >= 10 || Minor >= 100 || Micro >= 100) getDriver().Diag(diag::err_drv_invalid_version_number) - << Version->getAsString(Args); + << iOSVersion->getAsString(Args); } else llvm_unreachable("unknown kind of Darwin platform"); - // In GCC, the simulator historically was treated as being OS X in some - // contexts, like determining the link logic, despite generally being called - // with an iOS deployment target. For compatibility, we detect the - // simulator as iOS + x86, and treat it differently in a few contexts. + // Recognize iOS targets with an x86 architecture as the iOS simulator. if (iOSVersion && (getTriple().getArch() == llvm::Triple::x86 || getTriple().getArch() == llvm::Triple::x86_64)) Platform = IPhoneOSSimulator; |

