aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
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