aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-06-30 12:20:54 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-06-30 12:20:54 +0000
commit1d468b06b93557dedbb74e130a4b7b830876038d (patch)
treefdc8a31036095a1dc3ec7c1c5847b98e9374af60 /gcc/cp/parser.c
parent533374223d1c9eedba6d7ec1631835427aa1ca08 (diff)
downloadgcc-1d468b06b93557dedbb74e130a4b7b830876038d.zip
gcc-1d468b06b93557dedbb74e130a4b7b830876038d.tar.gz
gcc-1d468b06b93557dedbb74e130a4b7b830876038d.tar.bz2
c-parser.c (c_parser_omp_for_loop): Use a VEC for for_block.
gcc/ * c-parser.c (c_parser_omp_for_loop): Use a VEC for for_block. gcc/cp/ * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block. From-SVN: r161599
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 4e4db2d..e8f10a4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22705,11 +22705,12 @@ static tree
cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
{
tree init, cond, incr, body, decl, pre_body = NULL_TREE, ret;
- tree for_block = NULL_TREE, real_decl, initv, condv, incrv, declv;
+ tree real_decl, initv, condv, incrv, declv;
tree this_pre_body, cl;
location_t loc_first;
bool collapse_err = false;
int i, collapse = 1, nbraces = 0;
+ VEC(tree,gc) *for_block = make_tree_vector ();
for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
@@ -22828,8 +22829,7 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
LOOKUP_ONLYCONVERTING);
if (CLASS_TYPE_P (TREE_TYPE (decl)))
{
- for_block
- = tree_cons (NULL, this_pre_body, for_block);
+ VEC_safe_push (tree, gc, for_block, this_pre_body);
init = NULL_TREE;
}
else
@@ -23083,11 +23083,9 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
}
}
- while (for_block)
- {
- add_stmt (pop_stmt_list (TREE_VALUE (for_block)));
- for_block = TREE_CHAIN (for_block);
- }
+ while (!VEC_empty (tree, for_block))
+ add_stmt (pop_stmt_list (VEC_pop (tree, for_block)));
+ release_tree_vector (for_block);
return ret;
}