diff options
author | Joseph Myers <joseph@codesourcery.com> | 2011-05-05 11:20:31 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2011-05-05 11:20:31 +0100 |
commit | a04a722b88baf5568f3ba02a07189cbd65b0dc22 (patch) | |
tree | b17a45e382a8a322480a5f68a04bd1948915571e /gcc/objc/objc-act.c | |
parent | c92a6f97df83d8ee957dbfd7871a0ad517dcd699 (diff) | |
download | gcc-a04a722b88baf5568f3ba02a07189cbd65b0dc22.zip gcc-a04a722b88baf5568f3ba02a07189cbd65b0dc22.tar.gz gcc-a04a722b88baf5568f3ba02a07189cbd65b0dc22.tar.bz2 |
c-decl.c (finish_decl): Don't call get_pending_sizes.
* c-decl.c (finish_decl): Don't call get_pending_sizes.
(grokparm): Add parameter expr. Pass it to grokdeclarator.
(push_parm_decl): Add parameter expr. Pass it to grokdeclarator.
(c_variable_size): Remove.
(grokdeclarator): Use save_expr instead of c_variable_size. Don't
call put_pending_sizes.
(get_parm_info): Add parameter expr. Use it to set
arg_info->pending_sizes.
(store_parm_decls): Use arg_info->pending_sizes instead or calling
get_pending_sizes.
* c-parser.c (c_parser_parms_declarator): Update call to
c_parser_parms_list_declarator.
(c_parser_parms_list_declarator): Take parameter expr. Update
call to push_parm_decl. Update recursive call. Don't call
get_pending_sizes. Update calls to get_parm_info.
(c_parser_objc_method_definition): Update calls to
c_parser_objc_method_decl and objc_start_method_definition.
(c_parser_objc_methodproto): Update call to
c_parser_objc_method_decl.
(c_parser_objc_method_decl): Add parameter expr. Update call to
grokparm.
(c_parser_objc_try_catch_finally_statement): Update call to
grokparm.
* c-tree.h (struct c_arg_info.pending_sizes): Change to a tree.
(get_parm_info, grokparm, push_parm_decl): Update prototypes.
c-family:
* c-objc.h (objc_start_method_definition): Update prototype.
* stub-objc.c (objc_start_method_definition): Add extra parameter.
cp:
* parser.c (cp_parser_objc_method_definition_list): Update call to
objc_start_method_definition.
objc:
* objc-act.c (objc_start_method_definition): Add parameter expr.
Update call to start_method_def.
(objc_generate_cxx_ctor_or_dtor, objc_synthesize_getter,
objc_synthesize_setter) Update calls to
objc_start_method_definition.
(objc_get_parm_info): Add parameter expr. Update call to
get_parm_info.
(start_method_def): Add parameter expr. Update call to
objc_get_parm_info.
* objc-gnu-runtime-abi-01.c (build_module_initializer_routine):
Update call to objc_get_parm_info.
* objc-runtime-shared-support.h (objc_get_parm_info): Add extra
parameter.
From-SVN: r173422
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 025f375..46cfc55 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -126,7 +126,7 @@ static void synth_module_prologue (void); static tree start_class (enum tree_code, tree, tree, tree, tree); static tree continue_class (tree); static void finish_class (tree); -static void start_method_def (tree); +static void start_method_def (tree, tree); static tree start_protocol (enum tree_code, tree, tree, tree); static tree build_method_decl (enum tree_code, tree, tree, tree, bool); @@ -2041,9 +2041,12 @@ objc_add_method_declaration (bool is_class_method, tree decl, tree attributes) /* Return 'true' if the method definition could be started, and 'false' if not (because we are outside an @implementation context). + EXPR is NULL or an expression that needs to be evaluated for the + side effects of array size expressions in the parameters. */ bool -objc_start_method_definition (bool is_class_method, tree decl, tree attributes) +objc_start_method_definition (bool is_class_method, tree decl, tree attributes, + tree expr) { if (!objc_implementation_context) { @@ -2070,7 +2073,7 @@ objc_start_method_definition (bool is_class_method, tree decl, tree attributes) decl, is_class_method, /* is optional */ false); - start_method_def (decl); + start_method_def (decl, expr); return true; } @@ -4557,7 +4560,7 @@ objc_generate_cxx_ctor_or_dtor (bool dtor) ? TAG_CXX_DESTRUCT : TAG_CXX_CONSTRUCT), make_node (TREE_LIST), - false), NULL); + false), NULL, NULL_TREE); body = begin_function_body (); compound_stmt = begin_compound_stmt (0); @@ -7214,7 +7217,8 @@ objc_synthesize_getter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr decl = copy_node (decl); DECL_SOURCE_LOCATION (decl) = location; - objc_start_method_definition (false /* is_class_method */, decl, NULL_TREE); + objc_start_method_definition (false /* is_class_method */, decl, NULL_TREE, + NULL_TREE); body = c_begin_compound_stmt (true); /* Now we need to decide how we build the getter. There are three @@ -7393,7 +7397,8 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr decl = copy_node (decl); DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (property); - objc_start_method_definition (false /* is_class_method */, decl, NULL_TREE); + objc_start_method_definition (false /* is_class_method */, decl, NULL_TREE, + NULL_TREE); body = c_begin_compound_stmt (true); @@ -8287,7 +8292,8 @@ objc_push_parm (tree parm) #ifdef OBJCPLUS tree -objc_get_parm_info (int have_ellipsis ATTRIBUTE_UNUSED) +objc_get_parm_info (int have_ellipsis ATTRIBUTE_UNUSED, + tree expr ATTRIBUTE_UNUSED) { tree parm_info = objc_parmlist; objc_parmlist = NULL_TREE; @@ -8296,7 +8302,7 @@ objc_get_parm_info (int have_ellipsis ATTRIBUTE_UNUSED) } #else struct c_arg_info * -objc_get_parm_info (int have_ellipsis) +objc_get_parm_info (int have_ellipsis, tree expr) { tree parm_info = objc_parmlist; struct c_arg_info *arg_info; @@ -8313,7 +8319,7 @@ objc_get_parm_info (int have_ellipsis) finish_decl (parm_info, input_location, NULL_TREE, NULL_TREE, NULL_TREE); parm_info = next; } - arg_info = get_parm_info (have_ellipsis); + arg_info = get_parm_info (have_ellipsis, expr); pop_scope (); objc_parmlist = NULL_TREE; return arg_info; @@ -8348,10 +8354,12 @@ synth_self_and_ucmd_args (void) /* Transform an Objective-C method definition into a static C function definition, synthesizing the first two arguments, "self" and "_cmd", - in the process. */ + in the process. EXPR is NULL or an expression that needs to be + evaluated for the side effects of array size expressions in the + parameters. */ static void -start_method_def (tree method) +start_method_def (tree method, tree expr) { tree parmlist; #ifdef OBJCPLUS @@ -8406,7 +8414,7 @@ start_method_def (tree method) have_ellipsis = 1; } - parm_info = objc_get_parm_info (have_ellipsis); + parm_info = objc_get_parm_info (have_ellipsis, expr); really_start_method (objc_method_context, parm_info); } |