From: Fariborz Jahanian <fjahanian@apple.com>
Date: Tue, 15 Oct 2013 17:16:30 +0000 (+0000)
Subject: ObjectiveC driver. Scrap -fno-objc-legacy-dispatch for NeXT
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6f5cc368bb6c996f771c37b0e95d81bf1ded76e;p=clang

ObjectiveC driver. Scrap -fno-objc-legacy-dispatch for NeXT
runtime. It will be silently ignored and regardless
of deployment target. // rdar://14803286


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

diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h
index 18ef64a315..52f35a0189 100644
--- a/include/clang/Basic/ObjCRuntime.h
+++ b/include/clang/Basic/ObjCRuntime.h
@@ -98,9 +98,8 @@ public:
           Arch == llvm::Triple::x86 ||
           Arch == llvm::Triple::x86_64)
         return false;
-      // Mac runtimes use legacy dispatch everywhere except x86-64
-    } else if (isNeXTFamily() && isNonFragile())
-        return Arch != llvm::Triple::x86_64;
+    }
+    // Mac runtimes use legacy dispatch everywhere now.
     return true;
   }
 
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 8cf35e8e26..9b23cbf931 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3195,8 +3195,9 @@ 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.
-  if (objcRuntime.isNonFragile()) {
+  // legacy is the default. Next runtime is always legacy dispatch and
+  // -fno-objc-legacy-dispatch gets ignored silently.
+  if (objcRuntime.isNonFragile() && !objcRuntime.isNeXTFamily()) {
     if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch,
                       options::OPT_fno_objc_legacy_dispatch,
                       objcRuntime.isLegacyDispatchDefaultForArch(
diff --git a/test/Driver/darwin-objc-defaults.m b/test/Driver/darwin-objc-defaults.m
index b523c0b482..1742deb1b1 100644
--- a/test/Driver/darwin-objc-defaults.m
+++ b/test/Driver/darwin-objc-defaults.m
@@ -37,7 +37,6 @@
 
 // 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 \
@@ -46,7 +45,6 @@
 
 // CHECK-CHECK-X86_64_OSX10_6: "-cc1"
 // CHECK-CHECK-X86_64_OSX10_6: -fobjc-runtime=macosx-10.6
-// CHECK-CHECK-X86_64_OSX10_6: -fobjc-dispatch-method=mixed
 // CHECK-CHECK-X86_64_OSX10_6: darwin-objc-defaults
 
 // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
@@ -55,7 +53,6 @@
 
 // CHECK-CHECK-X86_64_IPHONE3_0: "-cc1"
 // CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-runtime=ios-3.0
-// CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-dispatch-method=mixed
 // CHECK-CHECK-X86_64_IPHONE3_0: darwin-objc-defaults
 
 // armv7
diff --git a/test/Driver/rewrite-objc.m b/test/Driver/rewrite-objc.m
index 38e64c0e40..95db58294d 100644
--- a/test/Driver/rewrite-objc.m
+++ b/test/Driver/rewrite-objc.m
@@ -3,4 +3,4 @@
 // TEST0: clang{{.*}}" "-cc1"
 // TEST0: "-rewrite-objc"
 // FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fobjc-dispatch-method=mixed" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"