]> granicus.if.org Git - clang/commitdiff
modern objective-c translator: fix type of objc_exception_throw
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Mar 2012 18:11:32 +0000 (18:11 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 19 Mar 2012 18:11:32 +0000 (18:11 +0000)
declaration and its siblings.

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

lib/Rewrite/RewriteModernObjC.cpp
test/Rewriter/rewrite-modern-synchronized.m
test/Rewriter/rewrite-modern-throw.m
test/Rewriter/rewrite-modern-try-catch-finally.m
test/Rewriter/rewrite-modern-try-finally.m

index 78e0dbce7c17395dffd18d129ff8cb3d6bbb9b54..648bce7be2e8a94475de0a3fd895057194d85a23 100644 (file)
@@ -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";
index 6dbba9a18c74c8960939fc18c59cc1e224c1330d..e89533930388e149ce7aae8da106d3d6dcc7773b 100644 (file)
@@ -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 *);
 
index 96d0e1c9ec437e59bee0d96d0c4643b2845f0ecd..191238443d3d73fcbbd1f3961e59bb28ad304c51 100644 (file)
@@ -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 *);
 
index 5b222fdd21b13e770d689716b4b838e237076744..9beab7d751006c1e751f21e24f58f79f6751af73 100644 (file)
@@ -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 *, ...);
 
index cf342d746de796c0f3aabd4b0785461953e95de3..500133b8614266f28610bed22d7ce1424a90c3ad 100644 (file)
@@ -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();