From 7b1124877bf99491ff9128243a692a05567d9864 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 30 Aug 2004 20:21:48 +0100 Subject: [PATCH] c-tree.h (struct language_function): Add arg_info element. * c-tree.h (struct language_function): Add arg_info element. * c-decl.c (current_function_arg_info): New. (grokdeclarator, store_parm_decls): Use it instead of DECL_ARGUMENTS. (c_push_function_context, c_pop_function_context): Save and restore it. From-SVN: r86798 --- gcc/ChangeLog | 9 +++++++++ gcc/c-decl.c | 18 +++++++++++++----- gcc/c-tree.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 15a9897ae95..0017a24ac8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-08-30 Joseph S. Myers + + * c-tree.h (struct language_function): Add arg_info element. + * c-decl.c (current_function_arg_info): New. + (grokdeclarator, store_parm_decls): Use it instead of + DECL_ARGUMENTS. + (c_push_function_context, c_pop_function_context): Save and + restore it. + 2004-08-30 Richard Henderson * c-typeck.c (build_unary_op): Don't expand ADDR_EXPR of a diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a8f25304c79..7ef352e3541 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -104,6 +104,11 @@ static int enum_overflow; static location_t current_function_prototype_locus; +/* The argument information structure for the function currently being + defined. */ + +static GTY(()) tree current_function_arg_info; + /* The current statement tree. */ static GTY(()) struct stmt_tree_s c_stmt_tree; @@ -4704,10 +4709,9 @@ grokdeclarator (tree declarator, tree declspecs, = !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO))); /* For a function definition, record the argument information - block in DECL_ARGUMENTS where store_parm_decls will look - for it. */ + block where store_parm_decls will look for it. */ if (funcdef_flag) - DECL_ARGUMENTS (decl) = arg_info; + current_function_arg_info = arg_info; if (defaulted_int) C_FUNCTION_IMPLICIT_INT (decl) = 1; @@ -6352,16 +6356,18 @@ void store_parm_decls (void) { tree fndecl = current_function_decl; + bool proto; /* The argument information block for FNDECL. */ - tree arg_info = DECL_ARGUMENTS (fndecl); + tree arg_info = current_function_arg_info; + current_function_arg_info = 0; /* True if this definition is written with a prototype. Note: despite C99 6.7.5.3p14, we can *not* treat an empty argument list in a function definition as equivalent to (void) -- an empty argument list specifies the function has no parameters, but only (void) sets up a prototype for future calls. */ - bool proto = ARG_INFO_TYPES (arg_info) != 0; + proto = ARG_INFO_TYPES (arg_info) != 0; if (proto) store_parm_decls_newstyle (fndecl, arg_info); @@ -6645,6 +6651,7 @@ c_push_function_context (struct function *f) p->x_break_label = c_break_label; p->x_cont_label = c_cont_label; p->x_switch_stack = c_switch_stack; + p->arg_info = current_function_arg_info; p->returns_value = current_function_returns_value; p->returns_null = current_function_returns_null; p->returns_abnormally = current_function_returns_abnormally; @@ -6673,6 +6680,7 @@ c_pop_function_context (struct function *f) c_break_label = p->x_break_label; c_cont_label = p->x_cont_label; c_switch_stack = p->x_switch_stack; + current_function_arg_info = p->arg_info; current_function_returns_value = p->returns_value; current_function_returns_null = p->returns_null; current_function_returns_abnormally = p->returns_abnormally; diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 851b3a4beb9..329948ade53 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -135,6 +135,7 @@ struct language_function GTY(()) tree x_break_label; tree x_cont_label; struct c_switch * GTY((skip)) x_switch_stack; + tree arg_info; int returns_value; int returns_null; int returns_abnormally; -- 2.30.2