r199682 - ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
Fariborz Jahanian
fjahanian at apple.com
Mon Jan 20 11:32:34 PST 2014
Author: fjahanian
Date: Mon Jan 20 13:32:33 2014
New Revision: 199682
URL: http://llvm.org/viewvc/llvm-project?rev=199682&view=rev
Log:
ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
when the deployment target is 10.5. // rdar://15852259
Modified:
cfe/trunk/include/clang/Basic/ObjCRuntime.h
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/darwin-objc-defaults.m
Modified: cfe/trunk/include/clang/Basic/ObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/ObjCRuntime.h?rev=199682&r1=199681&r2=199682&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/ObjCRuntime.h (original)
+++ cfe/trunk/include/clang/Basic/ObjCRuntime.h Mon Jan 20 13:32:33 2014
@@ -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;
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=199682&r1=199681&r2=199682&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jan 20 13:32:33 2014
@@ -3324,9 +3324,10 @@ void Clang::ConstructJob(Compilation &C,
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(
Modified: cfe/trunk/test/Driver/darwin-objc-defaults.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-objc-defaults.m?rev=199682&r1=199681&r2=199682&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-objc-defaults.m (original)
+++ cfe/trunk/test/Driver/darwin-objc-defaults.m Mon Jan 20 13:32:33 2014
@@ -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 \
More information about the cfe-commits
mailing list