diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-17 23:41:26 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-17 23:41:26 +0000 |
commit | b56e6ad87feb654e4ca265311344f4467a55a810 (patch) | |
tree | 84c8fd1367d35f514a4a3eb1e2ae2f23e53c13b7 /lib/Driver/ToolChains.cpp | |
parent | ea0114313fbfba99f7067a2464c523e96a08e365 (diff) |
Remove the hack where we sniff the __IPHONE_OS_VERSION_MIN_REQUIRED define.
We can use -mios-simulator-version-min now. rdar://10218700
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 825a83d8b8..12c263aad0 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -454,35 +454,6 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } } -static inline StringRef SimulatorVersionDefineName() { - return "__IPHONE_OS_VERSION_MIN_REQUIRED"; -} - -/// \brief Parse the simulator version define: -/// __IPHONE_OS_VERSION_MIN_REQUIRED=([0-9])([0-9][0-9])([0-9][0-9]) -// and return the grouped values as integers, e.g: -// __IPHONE_OS_VERSION_MIN_REQUIRED=40201 -// will return Major=4, Minor=2, Micro=1. -static bool GetVersionFromSimulatorDefine(StringRef define, - unsigned &Major, unsigned &Minor, - unsigned &Micro) { - assert(define.startswith(SimulatorVersionDefineName())); - StringRef name, version; - llvm::tie(name, version) = define.split('='); - if (version.empty()) - return false; - std::string verstr = version.str(); - char *end; - unsigned num = (unsigned) strtol(verstr.c_str(), &end, 10); - if (*end != '\0') - return false; - Major = num / 10000; - num = num % 10000; - Minor = num / 100; - Micro = num % 100; - return true; -} - void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { const OptTable &Opts = getDriver().getOpts(); @@ -491,28 +462,6 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { Arg *iOSSimVersion = Args.getLastArg( options::OPT_mios_simulator_version_min_EQ); - // FIXME: HACK! When compiling for the simulator we don't get a - // '-miphoneos-version-min' to help us know whether there is an ARC runtime - // or not; try to parse a __IPHONE_OS_VERSION_MIN_REQUIRED - // define passed in command-line. - if (!iOSVersion) { - for (arg_iterator it = Args.filtered_begin(options::OPT_D), - ie = Args.filtered_end(); it != ie; ++it) { - StringRef define = (*it)->getValue(Args); - if (define.startswith(SimulatorVersionDefineName())) { - unsigned Major = 0, Minor = 0, Micro = 0; - if (GetVersionFromSimulatorDefine(define, Major, Minor, Micro) && - Major < 10 && Minor < 100 && Micro < 100) { - ARCRuntimeForSimulator = Major < 5 ? ARCSimulator_NoARCRuntime - : ARCSimulator_HasARCRuntime; - LibCXXForSimulator = Major < 5 ? LibCXXSimulator_NotAvailable - : LibCXXSimulator_Available; - } - break; - } - } - } - if (OSXVersion && (iOSVersion || iOSSimVersion)) { getDriver().Diag(diag::err_drv_argument_not_allowed_with) << OSXVersion->getAsString(Args) |