]> granicus.if.org Git - clang/commitdiff
Force clang to produce legacy api for messaging
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Apr 2010 17:53:30 +0000 (17:53 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Apr 2010 17:53:30 +0000 (17:53 +0000)
in for pre-snowleoprd (NeXt runtime). Fixes
radar 7866951

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

lib/CodeGen/CGObjCMac.cpp
test/CodeGenObjC/legacy-api-leopard-test.m [new file with mode: 0644]

index f038509edc5bab62a06e0fdd2099ad42a8f0d471..d70537e49c961fa3774b25602272b98dd6bc9cf3 100644 (file)
@@ -4264,7 +4264,10 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() {
 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"));
diff --git a/test/CodeGenObjC/legacy-api-leopard-test.m b/test/CodeGenObjC/legacy-api-leopard-test.m
new file mode 100644 (file)
index 0000000..1a229c6
--- /dev/null
@@ -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
+
+@interface NSObject 
+- (id)init;
+@end
+
+@interface ClangTest : NSObject @end
+
+@implementation ClangTest
+- (id)init
+{
+ [super init];
+ return self;
+}
+@end
+
+// CHECK-LP64: objc_msgSendSuper2_fixup_init
+// CHECK-LP64: objc_msgSendSuper2_fixup