aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-10-18 23:28:20 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-10-18 23:28:20 +0000
commitda57d1b98f8ca9d1304fe66ff14315f12ce2a14f (patch)
tree59330bf1f36ce8580abaac8db170b72523706080 /gcc/objc
parent0069111f9c747028548f8c5dd7b91c4e5358039d (diff)
downloadgcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.zip
gcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.tar.gz
gcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.tar.bz2
In gcc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Implemented parsing @synthesize and @dynamic for Objective-C. * c-parser.c (c_parser_external_declaration): Recognize RID_AT_SYNTHESIZE and RID_AT_DYNAMIC. (c_parser_objc_at_synthesize_declaration): New. (c_parser_objc_at_dynamic_declaration): New. 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> * c-parser.c (c_parser_objc_class_declaration): After finding an error, parse the whole declaration then reset parser->error. In gcc/cp/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Implemented parsing @synthesize and @dynamic for Objective-C++. * parser.c (cp_parser_objc_method_definition_list): Recognize RID_AT_SYNTHESIZE and RID_AT_DYNAMIC. (cp_parser_objc_at_dynamic_declaration): New. (cp_parser_objc_at_synthesize_declaration): New. 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> * parser.c (cp_parser_objc_identifier_list): Check the return value of cp_parser_identifier and react if it is error_mark_node. In gcc/objc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Implemented parsing @synthesize and @dynamic for Objective-C/Objective-C++. * objc-act.c (objc_add_synthesize_declaration): New. (objc_add_dynamic_declaration): New. 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (lookup_and_install_protocols): Return NULL if passed error_mark_node. In gcc/testsuite/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Implemented parsing @synthesize and @dynamic for Objective-C/Objective-C++. * objc.dg/property/dynamic-1.m: New. * objc.dg/property/synthesize-1.m: New. * obj-c++.dg/property/dynamic-1.mm: New. * obj-c++.dg/property/synthesize-1.mm: New. 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/at-class-1.m: New. * objc.dg/at-class-1.mm: New. From-SVN: r165667
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog12
-rw-r--r--gcc/objc/objc-act.c52
2 files changed, 64 insertions, 0 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index fd8f15d..745b7bb 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,5 +1,17 @@
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+ Implemented parsing @synthesize and @dynamic for
+ Objective-C/Objective-C++.
+ * objc-act.c (objc_add_synthesize_declaration): New.
+ (objc_add_dynamic_declaration): New.
+
+2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-act.c (lookup_and_install_protocols): Return NULL if passed
+ error_mark_node.
+
+2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+
Merge from 'apple/trunk' branch on FSF servers.
2006-03-10 Fariborz Jahanian <fjahanian@apple.com>
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 53a29bc..048d2ae 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -2114,6 +2114,9 @@ lookup_and_install_protocols (tree protocols)
tree proto;
tree return_value = NULL_TREE;
+ if (protocols == error_mark_node)
+ return NULL;
+
for (proto = protocols; proto; proto = TREE_CHAIN (proto))
{
tree ident = TREE_VALUE (proto);
@@ -8701,6 +8704,55 @@ objc_synthesize_setter (tree klass, tree class_method, tree property)
objc_finish_method_definition (fn);
}
+/* This function is called by the parser after a @synthesize
+ expression is parsed. 'start_locus' is the location of the
+ @synthesize expression, and 'property_and_ivar_list' is a chained
+ list of the property and ivar names.
+ */
+void
+objc_add_synthesize_declaration (location_t start_locus ATTRIBUTE_UNUSED, tree property_and_ivar_list ATTRIBUTE_UNUSED)
+{
+ if (property_and_ivar_list == error_mark_node)
+ return;
+
+ if (!objc_implementation_context)
+ {
+ /* We can get here only in Objective-C; the Objective-C++ parser
+ detects the problem while parsing, outputs the error
+ "misplaced '@synthesize' Objective-C++ construct" and skips
+ the declaration. */
+ error ("%<@synthesize%> not in @implementation context");
+ return;
+ }
+
+ /* TODO */
+ error ("%<@synthesize%> is not supported in this version of the compiler");
+}
+
+/* This function is called by the parser after a @dynamic expression
+ is parsed. 'start_locus' is the location of the @dynamic
+ expression, and 'property_list' is a chained list of all the
+ property names. */
+void
+objc_add_dynamic_declaration (location_t start_locus ATTRIBUTE_UNUSED, tree property_list ATTRIBUTE_UNUSED)
+{
+ if (property_list == error_mark_node)
+ return;
+
+ if (!objc_implementation_context)
+ {
+ /* We can get here only in Objective-C; the Objective-C++ parser
+ detects the problem while parsing, outputs the error
+ "misplaced '@dynamic' Objective-C++ construct" and skips the
+ declaration. */
+ error ("%<@dynamic%> not in @implementation context");
+ return;
+ }
+
+ /* TODO */
+ error ("%<@dynamic%> is not supported in this version of the compiler");
+}
+
/* Main routine to generate code/data for all the property information for
current implementation (class or category). CLASS is the interface where
ivars are declared. CLASS_METHODS is where methods are found which