зеркало из https://github.com/microsoft/clang-1.git
NeXT: Add support for -fobjc-legacy-dispatch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95005 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
984eb8611d
Коммит
2feefe8c19
|
@ -21,6 +21,7 @@
|
|||
#include "clang/AST/RecordLayout.h"
|
||||
#include "clang/AST/StmtObjC.h"
|
||||
#include "clang/Basic/LangOptions.h"
|
||||
#include "clang/CodeGen/CodeGenOptions.h"
|
||||
|
||||
#include "llvm/Intrinsics.h"
|
||||
#include "llvm/LLVMContext.h"
|
||||
|
@ -4224,6 +4225,9 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() {
|
|||
/// message dispatch call for all the rest.
|
||||
///
|
||||
bool CGObjCNonFragileABIMac::LegacyDispatchedSelector(Selector Sel) {
|
||||
if (CGM.getCodeGenOpts().ObjCLegacyDispatch)
|
||||
return true;
|
||||
|
||||
if (NonLegacyDispatchMethods.empty()) {
|
||||
NonLegacyDispatchMethods.insert(GetNullarySelector("alloc"));
|
||||
NonLegacyDispatchMethods.insert(GetNullarySelector("class"));
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_NEW_DISPATCH %s
|
||||
//
|
||||
// CHECK_NEW_DISPATCH: define void @f0
|
||||
// CHECK_NEW_DISPATCH: bitcast {{.*}}objc_msgSend_fixup_alloc
|
||||
// CHECK_NEW_DISPATCH: define void @f1
|
||||
// CHECK_NEW_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
|
||||
//
|
||||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-legacy-dispatch -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_OLD_DISPATCH %s
|
||||
//
|
||||
// CHECK_OLD_DISPATCH: define void @f0
|
||||
// CHECK_OLD_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
|
||||
// CHECK_OLD_DISPATCH: define void @f1
|
||||
// CHECK_OLD_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
|
||||
|
||||
@interface A
|
||||
+(id) alloc;
|
||||
-(int) im0;
|
||||
@end
|
||||
|
||||
void f0(void) {
|
||||
[A alloc];
|
||||
}
|
||||
|
||||
void f1(A *a) {
|
||||
[a im0];
|
||||
}
|
Загрузка…
Ссылка в новой задаче