From b4f588c48d3530ab687647ea2bc932656d2b5822 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Wed, 29 Dec 2010 12:22:09 +0000 Subject: In gcc/c-family/: 2010-12-29 Nicola Pero In gcc/c-family/: 2010-12-29 Nicola Pero PR objc/47075 * c-objc.h (objc_finish_message_expr): Added argument to prototype. In gcc/objc/: 2010-12-29 Nicola Pero PR objc/47075 * objc-act.h (PROPERTY_REF_DEPRECATED_GETTER): New. * objc-tree.def (PROPERTY_REF): Increased the number of operands from 3 to 4. * objc-act.c (objc_finish_message_expr): Added optional argument allowing to return the deprecated method prototype for deprecated methods, instead of immediately emitting the deprecation warning. (objc_maybe_build_component_ref): Do not warn for a deprecated property. When building the getter call, get the deprecated method prototype from objc_finish_message_expr() and put it into the PROPERTY_REF. (objc_build_class_component_ref): Same change. (finish_class): Mark the getter and setter as deprecated if they are generated from a deprecated property. (objc_gimplify_property_ref): If the getter is deprecated, emit a deprecation warning. (objc_build_setter_call, objc_build_message_expr, objc_finish_foreach_loop): Updated call to objc_finish_message_expr. In gcc/objcp/: 2010-12-29 Nicola Pero * objcp-lang.c (objcp_tsubst_copy_and_build): Update call to objc_finish_message_expr. In gcc/testsuite/: 2010-12-29 Nicola Pero PR objc/47075 * objc.dg/property/at-property-deprecated-1.m: Updated. * objc.dg/property/at-property-deprecated-2.m: New. * objc.dg/property/dotsyntax-deprecated-1.m: New. * obj-c++.dg/property/at-property-deprecated-1.mm: Updated. * obj-c++.dg/property/at-property-deprecated-2.mm: New. * obj-c++.dg/property/dotsyntax-deprecated-1.mm: New. From-SVN: r168315 --- gcc/objc/objc-tree.def | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/objc/objc-tree.def') diff --git a/gcc/objc/objc-tree.def b/gcc/objc/objc-tree.def index e33fc78db29..f72f2332dea 100644 --- a/gcc/objc/objc-tree.def +++ b/gcc/objc/objc-tree.def @@ -46,7 +46,10 @@ DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", tcc_expression, 1) representing the expression), and Operand 1 is the property (the PROPERTY_DECL). Operand 2 is the 'getter' call, ready to be used; we pregenerate it because it is hard to generate it properly later - on. A PROPERTY_REF tree needs to be transformed into 'setter' and + on. Operand 3 records whether using the 'getter' call should + generate a deprecation warning or not. + + A PROPERTY_REF tree needs to be transformed into 'setter' and 'getter' calls at some point; at the moment this happens in two places: @@ -58,13 +61,14 @@ DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", tcc_expression, 1) gimplification; at that point, we convert each PROPERTY_REF into a 'getter' call during ObjC/ObjC++ gimplify. At that point, it is quite hard to build a 'getter' call, but we have already built - it and we just need to swap Operand 2 in. + it and we just need to swap Operand 2 in, and emit the deprecation + warnings from Operand 3 if needed. Please note that when the Objective-C 2.0 "dot-syntax" 'object.component' is encountered, where 'component' is not a property but there are valid setter/getter methods for it, an artificial PROPERTY_DECL is generated and used in the PROPERTY_REF. */ -DEFTREECODE (PROPERTY_REF, "property_ref", tcc_expression, 3) +DEFTREECODE (PROPERTY_REF, "property_ref", tcc_expression, 4) /* Local variables: -- cgit v1.2.1