diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp index 78e0dbce7c17..648bce7be2e8 100644 --- a/clang/lib/Rewrite/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/RewriteModernObjC.cpp @@ -5162,15 +5162,15 @@ void RewriteModernObjC::Initialize(ASTContext &context) { Preamble += "(struct objc_class *);\n"; Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getMetaClass"; Preamble += "(const char *);\n"; - Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw(id);\n"; + Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n"; Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_try_enter(void *);\n"; Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_try_exit(void *);\n"; Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_exception_extract(void *);\n"; Preamble += "__OBJC_RW_DLLIMPORT int objc_exception_match"; Preamble += "(struct objc_class *, struct objc_object *);\n"; // @synchronized hooks. - Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_enter(id);\n"; - Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_exit(id);\n"; + Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_enter( struct objc_object *);\n"; + Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_exit( struct objc_object *);\n"; Preamble += "__OBJC_RW_DLLIMPORT Protocol *objc_getProtocol(const char *);\n"; Preamble += "#ifndef __FASTENUMERATIONSTATE\n"; Preamble += "struct __objcFastEnumerationState {\n\t"; diff --git a/clang/test/Rewriter/rewrite-modern-synchronized.m b/clang/test/Rewriter/rewrite-modern-synchronized.m index 6dbba9a18c74..e89533930388 100644 --- a/clang/test/Rewriter/rewrite-modern-synchronized.m +++ b/clang/test/Rewriter/rewrite-modern-synchronized.m @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp + +typedef struct objc_class *Class; +typedef struct objc_object { + Class isa; +} *id; void *sel_registerName(const char *); diff --git a/clang/test/Rewriter/rewrite-modern-throw.m b/clang/test/Rewriter/rewrite-modern-throw.m index 96d0e1c9ec43..191238443d3d 100644 --- a/clang/test/Rewriter/rewrite-modern-throw.m +++ b/clang/test/Rewriter/rewrite-modern-throw.m @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp + +typedef struct objc_class *Class; +typedef struct objc_object { + Class isa; +} *id; void *sel_registerName(const char *); diff --git a/clang/test/Rewriter/rewrite-modern-try-catch-finally.m b/clang/test/Rewriter/rewrite-modern-try-catch-finally.m index 5b222fdd21b1..9beab7d75100 100644 --- a/clang/test/Rewriter/rewrite-modern-try-catch-finally.m +++ b/clang/test/Rewriter/rewrite-modern-try-catch-finally.m @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp + +typedef struct objc_class *Class; +typedef struct objc_object { + Class isa; +} *id; extern int printf(const char *, ...); diff --git a/clang/test/Rewriter/rewrite-modern-try-finally.m b/clang/test/Rewriter/rewrite-modern-try-finally.m index cf342d746de7..500133b86142 100644 --- a/clang/test/Rewriter/rewrite-modern-try-finally.m +++ b/clang/test/Rewriter/rewrite-modern-try-finally.m @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp + +typedef struct objc_class *Class; +typedef struct objc_object { + Class isa; +} *id; void FINALLY(); void TRY();