]> granicus.if.org Git - clang/commitdiff
ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 20 Jan 2014 19:32:33 +0000 (19:32 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 20 Jan 2014 19:32:33 +0000 (19:32 +0000)
when the deployment target is 10.5. // rdar://15852259

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199682 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/ObjCRuntime.h
lib/Driver/Tools.cpp
test/Driver/darwin-objc-defaults.m

index 4c6449750373acaf963aaae404b9f5e4896e3d49..37c9ec2bf631efced0eba6c19eafd80d7d5cbc8e 100644 (file)
@@ -99,6 +99,15 @@ public:
           Arch == llvm::Triple::x86_64)
         return false;
     }
+    else if (isNeXTFamily() && getVersion().getMajor() == 10) {
+      unsigned minor = 0;
+      if (getVersion().getMinor().hasValue())
+        minor = getVersion().getMinor().getValue();
+      if (minor == 5 &&
+          (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64))
+        return false;
+    }
+    // Except for deployment target of 10.5,
     // Mac runtimes use legacy dispatch everywhere now.
     return true;
   }
index 92f35f3538c97a75839e08aa7b0278a6b4f3143c..699d7cfdc249de9e9e66d6623e054cb71659b9b8 100644 (file)
@@ -3324,9 +3324,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   ObjCRuntime objcRuntime = AddObjCRuntimeArgs(Args, CmdArgs, rewriteKind);
 
   // -fobjc-dispatch-method is only relevant with the nonfragile-abi, and
-  // legacy is the default. Next runtime is always legacy dispatch and
-  // -fno-objc-legacy-dispatch gets ignored silently.
-  if (objcRuntime.isNonFragile() && !objcRuntime.isNeXTFamily()) {
+  // legacy is the default. Except for deployment taget of 10.5,
+  // next runtime is always legacy dispatch and -fno-objc-legacy-dispatch
+  // gets ignored silently.
+  if (objcRuntime.isNonFragile()) {
     if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch,
                       options::OPT_fno_objc_legacy_dispatch,
                       objcRuntime.isLegacyDispatchDefaultForArch(
index 1742deb1b12e839ecbc95e31254edb4e87826a43..6f5ed87d286a2cac07f4c9ec2c3cab378621574a 100644 (file)
@@ -37,6 +37,7 @@
 
 // CHECK-CHECK-X86_64_OSX10_5: "-cc1"
 // CHECK-CHECK-X86_64_OSX10_5: -fobjc-runtime=macosx-10.5
+// CHECK-CHECK-X86_64_OSX10_5: -fobjc-dispatch-method=non-legacy
 // CHECK-CHECK-X86_64_OSX10_5: darwin-objc-defaults
 
 // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \