diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2016-07-13 02:44:52 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2016-07-13 02:44:52 +0000 |
commit | 8c6812476a028328a11c68079d1714c9f81b6279 (patch) | |
tree | b23b2bc969495367f8ea5f18416b898c1494be56 /gcc/c | |
parent | fcd215916e0991815853999267824defe1963379 (diff) | |
download | gcc-8c6812476a028328a11c68079d1714c9f81b6279.zip gcc-8c6812476a028328a11c68079d1714c9f81b6279.tar.gz gcc-8c6812476a028328a11c68079d1714c9f81b6279.tar.bz2 |
use auto_vec for more local variables
gcc/c/ChangeLog:
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* c-parser.c (c_parser_generic_selection): Make type of variable
auto_vec.
(c_parser_omp_declare_simd): Likewise.
gcc/ChangeLog:
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* cfgexpand.c (expand_used_vars): Make the type of a local variable auto_vec.
* genmatch.c (lower_for): Likewise.
* haifa-sched.c (haifa_sched_init): Likewise.
(add_to_speculative_block): Likewise.
(create_check_block_twin): Likewise.
* predict.c (handle_missing_profiles): Likewise.
* tree-data-ref.c (loop_nest_has_data_refs): Likewise.
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Likewise.
* tree-ssa-loop-niter.c (discover_iteration_bound_by_body_walk): Likewise.
(maybe_lower_iteration_bound): Likewise.
* tree-ssa-sccvn.c (DFS): Likewise.
* tree-stdarg.c (reachable_at_most_once): Likewise.
* tree-vect-stmts.c (vectorizable_conversion): Likewise.
(vectorizable_store): Likewise.
From-SVN: r238285
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 59b296c..96dbf6b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,11 @@ 2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> + * c-parser.c (c_parser_generic_selection): Make type of variable + auto_vec. + (c_parser_omp_declare_simd): Likewise. + +2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> + * c-decl.c (struct c_struct_parse_info): Change member types from vec to auto_vec. (start_struct): Adjust. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 1a50dea..8fb4e4d 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -7243,7 +7243,6 @@ struct c_generic_association static struct c_expr c_parser_generic_selection (c_parser *parser) { - vec<c_generic_association> associations = vNULL; struct c_expr selector, error_expr; tree selector_type; struct c_generic_association matched_assoc; @@ -7300,6 +7299,7 @@ c_parser_generic_selection (c_parser *parser) return error_expr; } + auto_vec<c_generic_association> associations; while (1) { struct c_generic_association assoc, *iter; @@ -7320,13 +7320,13 @@ c_parser_generic_selection (c_parser *parser) if (type_name == NULL) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); - goto error_exit; + return error_expr; } assoc.type = groktypename (type_name, NULL, NULL); if (assoc.type == error_mark_node) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); - goto error_exit; + return error_expr; } if (TREE_CODE (assoc.type) == FUNCTION_TYPE) @@ -7345,14 +7345,14 @@ c_parser_generic_selection (c_parser *parser) if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); - goto error_exit; + return error_expr; } assoc.expression = c_parser_expr_no_commas (parser, NULL); if (assoc.expression.value == error_mark_node) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); - goto error_exit; + return error_expr; } for (ix = 0; associations.iterate (ix, &iter); ++ix) @@ -7408,8 +7408,6 @@ c_parser_generic_selection (c_parser *parser) c_parser_consume_token (parser); } - associations.release (); - if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>")) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); @@ -7425,10 +7423,6 @@ c_parser_generic_selection (c_parser *parser) } return matched_assoc.expression; - - error_exit: - associations.release (); - return error_expr; } /* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2). @@ -16366,14 +16360,13 @@ check_clauses: static void c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context) { - vec<c_token> clauses = vNULL; + auto_vec<c_token> clauses; while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL)) { c_token *token = c_parser_peek_token (parser); if (token->type == CPP_EOF) { c_parser_skip_to_pragma_eol (parser); - clauses.release (); return; } clauses.safe_push (*token); @@ -16395,7 +16388,6 @@ c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context) "%<#pragma omp declare simd%> must be followed by " "function declaration or definition or another " "%<#pragma omp declare simd%>"); - clauses.release (); return; } c_parser_consume_pragma (parser); @@ -16405,7 +16397,6 @@ c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context) if (token->type == CPP_EOF) { c_parser_skip_to_pragma_eol (parser); - clauses.release (); return; } clauses.safe_push (*token); @@ -16477,7 +16468,6 @@ c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context) default: gcc_unreachable (); } - clauses.release (); } /* Finalize #pragma omp declare simd clauses after FNDECL has been parsed, |