summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 05:45:37 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 05:45:37 +0000
commitc2078b806e007cf378451fcecda0d9f9a366fcc0 (patch)
tree15430a70b98350e546a27451e278ea2bc1aec992 /gcc/cp
parenta7920b67d3445222ee084dc2f0552e385027833a (diff)
downloadgcc-c2078b806e007cf378451fcecda0d9f9a366fcc0.tar.gz
add auto_vec
2013-11-22 Trevor Saunders <tsaunders@mozilla.com> gcc/ * vec.h (auto_vec): New class. * cfganal.c, cfgloop.c, cgraphunit.c, config/i386/i386.c, dwarf2out.c, function.c, genautomata.c, gimple.c, haifa-sched.c, ipa-inline.c, ira-build.c, loop-unroll.c, omp-low.c, ree.c, trans-mem.c, tree-call-cdce.c, tree-eh.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-predcom.c, tree-sra.c, tree-sssa-forwprop.c, tree-ssa-loop-manip.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-vect-loop.c, tree-vect-stmts.c: Use auto_vec and stack_vec as appropriate instead of vec for local variables. cp/ * parser.c, semantics.c: Change some local variables from vec to auto_vec or stack_vec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c4
-rw-r--r--gcc/cp/semantics.c20
3 files changed, 10 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1c0d9b7c121..5e769c30eec 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-22 Trevor Saunders <tsaunders@mozilla.com>
+
+ * parser.c, semantics.c: Change some local variables from vec to
+ auto_vec or stack_vec.
+
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* decl.c (reshape_init_array_1): Use tree_to_uhwi rather than
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 977adf6b791..bc86697793c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -30345,7 +30345,7 @@ static void
cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
enum pragma_context)
{
- vec<tree> types = vNULL;
+ auto_vec<tree> types;
enum tree_code reduc_code = ERROR_MARK;
tree reduc_id = NULL_TREE, orig_reduc_id = NULL_TREE, type;
unsigned int i;
@@ -30460,7 +30460,6 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
{
fail:
cp_parser_skip_to_pragma_eol (parser, pragma_tok);
- types.release ();
return;
}
@@ -30565,7 +30564,6 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
}
cp_parser_require_pragma_eol (parser, pragma_tok);
- types.release ();
}
/* OpenMP 4.0
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 11f781288e9..cd5a91d2c60 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4376,24 +4376,17 @@ handle_omp_array_sections (tree c)
{
bool maybe_zero_len = false;
unsigned int first_non_one = 0;
- vec<tree> types = vNULL;
+ auto_vec<tree> types;
tree first = handle_omp_array_sections_1 (c, OMP_CLAUSE_DECL (c), types,
maybe_zero_len, first_non_one);
if (first == error_mark_node)
- {
- types.release ();
- return true;
- }
+ return true;
if (first == NULL_TREE)
- {
- types.release ();
- return false;
- }
+ return false;
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND)
{
tree t = OMP_CLAUSE_DECL (c);
tree tem = NULL_TREE;
- types.release ();
if (processing_template_decl)
return false;
/* Need to evaluate side effects in the length expressions
@@ -4423,10 +4416,7 @@ handle_omp_array_sections (tree c)
if (int_size_in_bytes (TREE_TYPE (first)) <= 0)
maybe_zero_len = true;
if (processing_template_decl && maybe_zero_len)
- {
- types.release ();
- return false;
- }
+ return false;
for (i = num, t = OMP_CLAUSE_DECL (c); i > 0;
t = TREE_CHAIN (t))
@@ -4469,7 +4459,6 @@ handle_omp_array_sections (tree c)
"array section is not contiguous in %qs "
"clause",
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
- types.release ();
return true;
}
}
@@ -4525,7 +4514,6 @@ handle_omp_array_sections (tree c)
size = size_binop (MULT_EXPR, size, l);
}
}
- types.release ();
if (!processing_template_decl)
{
if (side_effects)