[cfe-commits] r156097 - in /cfe/trunk: lib/Rewrite/RewriteModernObjC.cpp test/Rewriter/objc-modern-getclass-proto.mm
Fariborz Jahanian
fjahanian at apple.com
Thu May 3 13:23:37 PDT 2012
Author: fjahanian
Date: Thu May 3 15:23:37 2012
New Revision: 156097
URL: http://llvm.org/viewvc/llvm-project?rev=156097&view=rev
Log:
modern objc translation. objc_getClass() and objc_getMetaClass()
prototypes should both return `struct objc_class *`.
// rdar://11375495
Added:
cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm
Modified:
cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=156097&r1=156096&r2=156097&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Thu May 3 15:23:37 2012
@@ -5727,11 +5727,11 @@
Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
- Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getClass";
+ Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getClass";
Preamble += "(const char *);\n";
Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
Preamble += "(struct objc_class *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getMetaClass";
+ Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass";
Preamble += "(const char *);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
// @synchronized hooks.
Added: cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm?rev=156097&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm (added)
+++ cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm Thu May 3 15:23:37 2012
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -E %s -o %t.mm
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %t.mm -o %t-rw.cpp
+// rdar://11375495
+
+ at interface I @end
+ at implementation I @end
+
+// CHECK: __OBJC_RW_DLLIMPORT struct objc_class *objc_getClass(const char *);
+// CHECK: __OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass(const char *);
More information about the cfe-commits
mailing list