aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-08-08 17:44:53 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-08-08 17:44:53 +0000
commitb3399d18c204d59f95146f44074c4f1639dad479 (patch)
tree86621b607f8bb644e7ccb61ff809d59519a940b2 /gcc/c-decl.c
parente60bf9d4f97a321bd1147853ab143fd93d12401c (diff)
downloadgcc-b3399d18c204d59f95146f44074c4f1639dad479.zip
gcc-b3399d18c204d59f95146f44074c4f1639dad479.tar.gz
gcc-b3399d18c204d59f95146f44074c4f1639dad479.tar.bz2
c-tree.h (build_arg_info): Declare.
* c-tree.h (build_arg_info): Declare. * c-decl.c (build_arg_info): Define. (get_parm_info): Call it. Delete initialization code. * c-parser.c (c_parser_parms_declarator): Likewise. (c_parser_parms_list_declaractor): Likewise. From-SVN: r163014
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index e4e872d..ec66692 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6176,6 +6176,22 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
}
}
+/* Allocate and initialize a c_arg_info structure from the parser's
+ obstack. */
+
+struct c_arg_info *
+build_arg_info (void)
+{
+ struct c_arg_info *ret = XOBNEW (&parser_obstack, struct c_arg_info);
+ ret->parms = NULL_TREE;
+ ret->tags = NULL;
+ ret->types = NULL_TREE;
+ ret->others = NULL_TREE;
+ ret->pending_sizes = NULL;
+ ret->had_vla_unspec = 0;
+ return ret;
+}
+
/* Take apart the current scope and return a c_arg_info structure with
info on a parameter list just parsed.
@@ -6188,8 +6204,8 @@ struct c_arg_info *
get_parm_info (bool ellipsis)
{
struct c_binding *b = current_scope->bindings;
- struct c_arg_info *arg_info = XOBNEW (&parser_obstack,
- struct c_arg_info);
+ struct c_arg_info *arg_info = build_arg_info ();
+
tree parms = 0;
VEC(c_arg_tag,gc) *tags = NULL;
tree types = 0;
@@ -6198,11 +6214,6 @@ get_parm_info (bool ellipsis)
static bool explained_incomplete_types = false;
bool gave_void_only_once_err = false;
- arg_info->parms = 0;
- arg_info->tags = 0;
- arg_info->types = 0;
- arg_info->others = 0;
- arg_info->pending_sizes = 0;
arg_info->had_vla_unspec = current_scope->had_vla_unspec;
/* The bindings in this scope must not get put into a block.