[llvm-branch-commits] [cfe-branch] r102251 - in /cfe/branches/Apple/williamson: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/legacy-api-leopard-test.m

Daniel Dunbar daniel at zuster.org
Sat Apr 24 10:48:17 PDT 2010


Author: ddunbar
Date: Sat Apr 24 12:48:17 2010
New Revision: 102251

URL: http://llvm.org/viewvc/llvm-project?rev=102251&view=rev
Log:
Force clang to produce legacy api for messaging in for pre-snowleoprd (NeXt runtime). Fixes radar 7866951

Added:
    cfe/branches/Apple/williamson/test/CodeGenObjC/legacy-api-leopard-test.m
Modified:
    cfe/branches/Apple/williamson/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/branches/Apple/williamson/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/lib/CodeGen/CGObjCMac.cpp?rev=102251&r1=102250&r2=102251&view=diff
==============================================================================
--- cfe/branches/Apple/williamson/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/branches/Apple/williamson/lib/CodeGen/CGObjCMac.cpp Sat Apr 24 12:48:17 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/branches/Apple/williamson/test/CodeGenObjC/legacy-api-leopard-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson/test/CodeGenObjC/legacy-api-leopard-test.m?rev=102251&view=auto
==============================================================================
--- cfe/branches/Apple/williamson/test/CodeGenObjC/legacy-api-leopard-test.m (added)
+++ cfe/branches/Apple/williamson/test/CodeGenObjC/legacy-api-leopard-test.m Sat Apr 24 12:48:17 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 llvm-branch-commits mailing list