aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2013-11-01 20:31:32 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2013-11-01 16:31:32 -0400
commit07687835bea637072221fdcbeb11cf14c43986f7 (patch)
tree9b926d72ddfbc7904a373e59872f1d07b4e4e417 /gcc/cp
parent654a6bb421af2e0aadccc0b29ce5af298519c8e9 (diff)
downloadgcc-07687835bea637072221fdcbeb11cf14c43986f7.zip
gcc-07687835bea637072221fdcbeb11cf14c43986f7.tar.gz
gcc-07687835bea637072221fdcbeb11cf14c43986f7.tar.bz2
Replace some heap vectors with stack vectors.
From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html This patch is pretty dull, it just replaces a bunch of things of the form vec<T> x; x.create (N); // N is a constant blah blah x.release (); by stack_vec<T, N> x; blah blah 2013-11-01 Trevor Saunders <tsaunders@mozilla.com> gcc/ * function.c (reorder_blocks): Convert block_stack to a stack_vec. * gimplify.c (gimplify_compound_lval): Likewise. * graphite-clast-to-gimple.c (gloog): Likewise. * graphite-dependences.c (loop_is_parallel_p): Likewise. * graphite-scop-detection.c (scopdet_basic_block_info): Likewise. (limit_scop); Likewise. (build_scops): Likewise. (dot_scop): Likewise. * graphite-sese-to-poly.c (sese_dom_walker): Likewise. (build_scop_drs): Likewise. (insert_stmts): Likewise. (insert_out_of_ssa_copy): Likewise. (remove_phi): Likewise. (rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise. * hw-doloop.c (discover_loop): Likewise. * tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise. * tree-dfa.c (dump_enumerated_decls): Likewise. * tree-if-conv.c (if_convertable_loop_p): Likewise. * tree-inline.c (tree_function_versioning): Likewise. * tree-loop-distribution.c (build_rdg): Likewise. (rdg_flag_vertex_and_dependent): Likewise. (distribute_loop): Likewise. * tree-parloops.c (loop_parallel_p): Likewise. (eliminate_local_variables): Likewise. (separate_decls_in_region): Likewise. * tree-predcom.c (tree_predictive_commoning_loop): Likewise. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker): Likewise. * tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise. * tree-vect-patterns.c (vect_pattern_recog): Likewise. * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise. (vectorizable_condition): Likewise. gcc/cp/ * semantics.c (build_anon_member_initialization): Convert fields to be a stack_vec. From-SVN: r204301
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e1dbb3b..d707fec 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
+
+ * semantics.c (build_anon_member_initialization): Convert fields to be
+ a stack_vec.
+
2013-11-01 Marc Glisse <marc.glisse@inria.fr>
PR c++/58834
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 6c560c6..366756f 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7439,8 +7439,7 @@ build_anon_member_initialization (tree member, tree init,
to build up the initializer from the outside in so that we can reuse
previously built CONSTRUCTORs if this is, say, the second field in an
anonymous struct. So we use a vec as a stack. */
- vec<tree> fields;
- fields.create (2);
+ stack_vec<tree, 2> fields;
do
{
fields.safe_push (TREE_OPERAND (member, 1));
@@ -7472,7 +7471,6 @@ build_anon_member_initialization (tree member, tree init,
/* Now we're at the innermost field, the one that isn't an anonymous
aggregate. Add its initializer to the CONSTRUCTOR and we're done. */
gcc_assert (fields.is_empty());
- fields.release ();
CONSTRUCTOR_APPEND_ELT (*vec, field, init);
return true;