[cfe-commits] r101791 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/legacy-api-leopard-test.m
Fariborz Jahanian
fjahanian at apple.com
Mon Apr 19 10:53:30 PDT 2010
Author: fjahanian
Date: Mon Apr 19 12:53:30 2010
New Revision: 101791
URL: http://llvm.org/viewvc/llvm-project?rev=101791&view=rev
Log:
Force clang to produce legacy api for messaging
in for pre-snowleoprd (NeXt runtime). Fixes
radar 7866951
Added:
cfe/trunk/test/CodeGenObjC/legacy-api-leopard-test.m
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=101791&r1=101790&r2=101791&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Apr 19 12:53:30 2010
@@ -4264,7 +4264,10 @@
bool CGObjCNonFragileABIMac::LegacyDispatchedSelector(Selector Sel) {
if (CGM.getCodeGenOpts().ObjCLegacyDispatch)
return true;
-
+ /* Leopard */
+ if (CGM.getContext().Target.getTriple().getDarwinMajorNumber() <= 9)
+ return false;
+
if (NonLegacyDispatchMethods.empty()) {
NonLegacyDispatchMethods.insert(GetNullarySelector("alloc"));
NonLegacyDispatchMethods.insert(GetNullarySelector("class"));
Added: cfe/trunk/test/CodeGenObjC/legacy-api-leopard-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/legacy-api-leopard-test.m?rev=101791&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/legacy-api-leopard-test.m (added)
+++ cfe/trunk/test/CodeGenObjC/legacy-api-leopard-test.m Mon Apr 19 12:53:30 2010
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
+// rdar: // 7866951
+
+ at interface NSObject
+- (id)init;
+ at end
+
+ at interface ClangTest : NSObject @end
+
+ at implementation ClangTest
+- (id)init
+{
+ [super init];
+ return self;
+}
+ at end
+
+// CHECK-LP64: objc_msgSendSuper2_fixup_init
+// CHECK-LP64: objc_msgSendSuper2_fixup
More information about the cfe-commits
mailing list