diff options
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 5 | ||||
-rw-r--r-- | clang/test/CodeGenObjC/legacy-api-leopard-test.m | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index f038509edc5..d70537e49c9 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -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/clang/test/CodeGenObjC/legacy-api-leopard-test.m b/clang/test/CodeGenObjC/legacy-api-leopard-test.m new file mode 100644 index 00000000000..1a229c6bb78 --- /dev/null +++ b/clang/test/CodeGenObjC/legacy-api-leopard-test.m @@ -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 |