From 3bb54680c4b6e7d918c82e96ecd56239e3149a5a Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 5 Feb 2014 17:13:42 +0000 Subject: [PATCH] Objective-C driver. Do not use legacy dispatch for 10.5 or less for x86_64 arch. // rdar://15852259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200854 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/ObjCRuntime.h | 4 ++-- test/Driver/darwin-objc-defaults.m | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index f65cc9345c..fa375f4e18 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -100,10 +100,10 @@ public: return false; } else if ((getKind() == MacOSX) && isNonFragile() && - (getVersion() >= VersionTuple(10, 5)) && + (getVersion() >= VersionTuple(10, 0)) && (getVersion() < VersionTuple(10, 6))) return Arch != llvm::Triple::x86_64; - // Except for deployment target of 10.5, + // Except for deployment target of 10.5 or less, // Mac runtimes use legacy dispatch everywhere now. return true; } diff --git a/test/Driver/darwin-objc-defaults.m b/test/Driver/darwin-objc-defaults.m index 6f5ed87d28..1b3f7a8444 100644 --- a/test/Driver/darwin-objc-defaults.m +++ b/test/Driver/darwin-objc-defaults.m @@ -31,10 +31,18 @@ // x86_64 +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ +// RUN: -arch x86_64 -mmacosx-version-min=10.4 2> %t +// RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_OSX10_4 < %t %s + +// CHECK-CHECK-X86_64_OSX10_4: "-cc1" +// CHECK-CHECK-X86_64_OSX10_4: -fobjc-dispatch-method=non-legacy + // RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch x86_64 -mmacosx-version-min=10.5 2> %t // RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_OSX10_5 < %t %s + // 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 -- 2.40.0