aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-08-08 17:42:40 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-08-08 17:42:40 +0000
commite60bf9d4f97a321bd1147853ab143fd93d12401c (patch)
tree1fc773b8a3cbcbc980aa5a7951f4ab0aea73bce5 /gcc/c-decl.c
parent4f8c876d4305f863ebccf6b0905be4d8a8d99be6 (diff)
downloadgcc-e60bf9d4f97a321bd1147853ab143fd93d12401c.zip
gcc-e60bf9d4f97a321bd1147853ab143fd93d12401c.tar.gz
gcc-e60bf9d4f97a321bd1147853ab143fd93d12401c.tar.bz2
c-tree.h (c_arg_tag): Define.
* c-tree.h (c_arg_tag): Define. Define a VEC containing it. (struct c_arg_info): Change type of tags field. * c-decl.c (grokdeclarator): Update for changed type of tags field. (get_parm_info): Likewise. (store_parm_decls_newstyle): Likewise. From-SVN: r163013
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 010421c..e4e872d 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5541,12 +5541,11 @@ grokdeclarator (const struct c_declarator *declarator,
the formal parameter list of this FUNCTION_TYPE to point to
the FUNCTION_TYPE node itself. */
{
- tree link;
+ c_arg_tag *tag;
+ unsigned ix;
- for (link = arg_info->tags;
- link;
- link = TREE_CHAIN (link))
- TYPE_CONTEXT (TREE_VALUE (link)) = type;
+ FOR_EACH_VEC_ELT_REVERSE (c_arg_tag, arg_info->tags, ix, tag)
+ TYPE_CONTEXT (tag->type) = type;
}
break;
}
@@ -6192,7 +6191,7 @@ get_parm_info (bool ellipsis)
struct c_arg_info *arg_info = XOBNEW (&parser_obstack,
struct c_arg_info);
tree parms = 0;
- tree tags = 0;
+ VEC(c_arg_tag,gc) *tags = NULL;
tree types = 0;
tree others = 0;
@@ -6246,6 +6245,7 @@ get_parm_info (bool ellipsis)
{
tree decl = b->decl;
tree type = TREE_TYPE (decl);
+ c_arg_tag *tag;
const char *keyword;
switch (TREE_CODE (decl))
@@ -6319,7 +6319,9 @@ get_parm_info (bool ellipsis)
}
}
- tags = tree_cons (b->id, decl, tags);
+ tag = VEC_safe_push (c_arg_tag, gc, tags, NULL);
+ tag->id = b->id;
+ tag->type = decl;
break;
case CONST_DECL:
@@ -7644,6 +7646,8 @@ static void
store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
{
tree decl;
+ c_arg_tag *tag;
+ unsigned ix;
if (current_scope->bindings)
{
@@ -7696,9 +7700,9 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
}
/* And all the tag declarations. */
- for (decl = arg_info->tags; decl; decl = TREE_CHAIN (decl))
- if (TREE_PURPOSE (decl))
- bind (TREE_PURPOSE (decl), TREE_VALUE (decl), current_scope,
+ FOR_EACH_VEC_ELT_REVERSE (c_arg_tag, arg_info->tags, ix, tag)
+ if (tag->id)
+ bind (tag->id, tag->type, current_scope,
/*invisible=*/false, /*nested=*/false, UNKNOWN_LOCATION);
}