[llvm-commits] [llvm-gcc-4.2] r110689 - in /llvm-gcc-4.2/trunk/gcc: objc/objc-act.c testsuite/objc.dg/qualified-id-property.m
Jim Grosbach
grosbach at apple.com
Tue Aug 10 10:21:06 PDT 2010
Author: grosbach
Date: Tue Aug 10 12:21:06 2010
New Revision: 110689
URL: http://llvm.org/viewvc/llvm-project?rev=110689&view=rev
Log:
Properly handle building a property setter name for a protocol. This fixes a
compiler ICE. Patch by Fariborz Jahanian. rdar://8287791
Added:
llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/qualified-id-property.m
Modified:
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=110689&r1=110688&r2=110689&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Tue Aug 10 12:21:06 2010
@@ -1935,6 +1935,23 @@
&& CLASS_SUPER_NAME (implementation_template))
class = lookup_interface (CLASS_SUPER_NAME (implementation_template));
}
+ /* APPLE LOCAL begin radar 8290584 */
+ else {
+ /* receiver could be of type id<protocol,...> find property in
+ protocol list. */
+ tree rprotos = (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype))
+ ? TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype))
+ : NULL_TREE);
+ if (rprotos) {
+ x = lookup_property_in_protocol_list (rprotos, property_ident);
+ if (x) {
+ return PROPERTY_SETTER_NAME (x) ?
+ IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (x)) :
+ objc_build_property_setter_name(property_ident, true);
+ }
+ }
+ }
+ /* APPLE LOCAL end radar 8290584 */
}
else
{
Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/qualified-id-property.m
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/qualified-id-property.m?rev=110689&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/qualified-id-property.m (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/qualified-id-property.m Tue Aug 10 12:21:06 2010
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file 8290584 */
+/* { dg-do compile } */
+
+ at protocol NetworkLoading
+ at property (assign, getter=isLoading) int loading;
+ at end
+
+extern id <NetworkLoading> GMMApp;
+
+ at interface I
+- (void) Meth;
+ at end
+
+ at implementation I
+- (void) Meth {
+ GMMApp.loading = 0;
+}
+
+ at end
More information about the llvm-commits
mailing list