diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-11-09 01:59:30 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-11-09 01:59:30 +0000 |
commit | 5ad5a9511ca1954162c84923996a7820ab712965 (patch) | |
tree | 09d32f2b6449de0bf3747c0fc22855389d4f23a1 /clang/lib/ARCMigrate/ARCMT.cpp | |
parent | 5ed8a8a06af21d443e3c10b0956f79ee069341c3 (diff) | |
download | bcm5719-llvm-5ad5a9511ca1954162c84923996a7820ab712965.tar.gz bcm5719-llvm-5ad5a9511ca1954162c84923996a7820ab712965.zip |
Remove old driver code to grab the iOS simulator version from the -D option.
We can now rely on the -mios-simulator-version-min command line option
and remove the awful hack. <rdar://problem/10304510>
llvm-svn: 167603
Diffstat (limited to 'clang/lib/ARCMigrate/ARCMT.cpp')
-rw-r--r-- | clang/lib/ARCMigrate/ARCMT.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 9a8f4925ffc..b57d9964736 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -147,54 +147,10 @@ public: } // end anonymous namespace -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; -} - static bool HasARCRuntime(CompilerInvocation &origCI) { // This duplicates some functionality from Darwin::AddDeploymentTarget // but this function is well defined, so keep it decoupled from the driver // and avoid unrelated complications. - - for (unsigned i = 0, e = origCI.getPreprocessorOpts().Macros.size(); - i != e; ++i) { - StringRef define = origCI.getPreprocessorOpts().Macros[i].first; - bool isUndef = origCI.getPreprocessorOpts().Macros[i].second; - if (isUndef) - continue; - if (!define.startswith(SimulatorVersionDefineName())) - continue; - unsigned Major = 0, Minor = 0, Micro = 0; - if (GetVersionFromSimulatorDefine(define, Major, Minor, Micro) && - Major < 10 && Minor < 100 && Micro < 100) - return Major >= 5; - } - llvm::Triple triple(origCI.getTargetOpts().Triple); if (triple.getOS() == llvm::Triple::IOS) |