[cfe-commits] r149040 - in /cfe/trunk: lib/Driver/ToolChains.cpp test/Driver/ios-simulator-arcruntime.c

Bob Wilson bob.wilson at apple.com
Wed Jan 25 19:37:03 PST 2012


Author: bwilson
Date: Wed Jan 25 21:37:03 2012
New Revision: 149040

URL: http://llvm.org/viewvc/llvm-project?rev=149040&view=rev
Log:
Revert r148249: "Make the auto-detection hack for the iOS simulator set the target triple correctly."

There were some problems with this, so I'm backing it out for now.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/test/Driver/ios-simulator-arcruntime.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=149040&r1=149039&r2=149040&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Jan 25 21:37:03 2012
@@ -533,6 +533,28 @@
   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 && !iOSSimVersion) {
+    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)
@@ -618,31 +640,6 @@
     }
   }
 
-  // FIXME: HACK! When compiling for the simulator we can't depend
-  // on getting '-mios-simulator-version-min'; try to parse a
-  // __IPHONE_OS_VERSION_MIN_REQUIRED define passed in command-line.
-  if (OSXVersion) {
-    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) {
-          std::string iOSSimTarget;
-          llvm::raw_string_ostream(iOSSimTarget)
-              << Major << '.' << Minor << '.' << Micro;
-          const Option *O = Opts.getOption(
-            options::OPT_mios_simulator_version_min_EQ);
-          iOSSimVersion = Args.MakeJoinedArg(0, O, iOSSimTarget);
-          Args.append(iOSSimVersion);
-          OSXVersion = 0;
-        }
-        break;
-      }
-    }
-  }
-
   // Reject invalid architecture combinations.
   if (iOSSimVersion && (getTriple().getArch() != llvm::Triple::x86 &&
                         getTriple().getArch() != llvm::Triple::x86_64)) {

Modified: cfe/trunk/test/Driver/ios-simulator-arcruntime.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ios-simulator-arcruntime.c?rev=149040&r1=149039&r2=149040&view=diff
==============================================================================
--- cfe/trunk/test/Driver/ios-simulator-arcruntime.c (original)
+++ cfe/trunk/test/Driver/ios-simulator-arcruntime.c Wed Jan 25 21:37:03 2012
@@ -3,5 +3,4 @@
 // 
 
 // CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak
-// CHECK-OPTIONS2: "-triple" "i386-apple-ios5.0.0"
 // CHECK-OPTIONS2: -fobjc-runtime-has-weak





More information about the cfe-commits mailing list