From 547bbe4977c9b9a963f8019b522db185c7e9bcdb Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 2 Oct 2015 08:10:46 +0000 Subject: [PATCH] trans.c (find_loop_for): Use FOR_EACH_VEC_ELT_REVERSE. * gcc-interface/trans.c (find_loop_for): Use FOR_EACH_VEC_ELT_REVERSE. (Loop_Statement_to_gnu): Use FOR_EACH_VEC_ELT. (finalize_nrv): Use FOR_EACH_VEC_SAFE_ELT and initialize field. (build_stmt_group): Add blank lines. From-SVN: r228373 --- gcc/ada/ChangeLog | 9 ++++++++- gcc/ada/gcc-interface/trans.c | 13 ++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d4c505c3fc5..fb8c6cc91a4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,10 +1,17 @@ +2015-10-02 Eric Botcazou + + * gcc-interface/trans.c (find_loop_for): Use FOR_EACH_VEC_ELT_REVERSE. + (Loop_Statement_to_gnu): Use FOR_EACH_VEC_ELT. + (finalize_nrv): Use FOR_EACH_VEC_SAFE_ELT and initialize field. + (build_stmt_group): Add blank lines. + 2015-09-30 Thomas Schwinge * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_11): Don't define. 2015-09-28 Tom de Vries - * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_6): Define + * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_6): Define. 2015-09-17 Eric Botcazou diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 96f0c55d48f..58e3d322258 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2644,9 +2644,7 @@ find_loop_for (tree var) gcc_assert (vec_safe_length (gnu_loop_stack) > 0); - for (i = vec_safe_length (gnu_loop_stack) - 1; - vec_safe_iterate (gnu_loop_stack, i, &iter); - i--) + FOR_EACH_VEC_ELT_REVERSE (*gnu_loop_stack, i, iter) if (var == iter->loop_var) break; @@ -3014,9 +3012,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node) - the front-end quickly generates useless or redundant checks that can be entirely optimized away in the end. */ if (1 <= n_checks && n_checks <= 4) - for (i = 0; - vec_safe_iterate (gnu_loop_info->checks, i, &rci); - i++) + FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci) { tree low_ok = rci->low_bound @@ -3426,8 +3422,9 @@ finalize_nrv (tree fndecl, bitmap nrv, vec *other, Node_Id gnat_ret /* Prune the candidates that are referenced by other return values. */ data.nrv = nrv; data.result = NULL_TREE; + data.gnat_ret = Empty; data.visited = NULL; - for (i = 0; vec_safe_iterate (other, i, &iter); i++) + FOR_EACH_VEC_SAFE_ELT (other, i, iter) walk_tree_without_duplicates (&iter, prune_nrv_r, &data); if (bitmap_empty_p (nrv)) return; @@ -7905,10 +7902,12 @@ static tree build_stmt_group (List_Id gnat_list, bool binding_p) { start_stmt_group (); + if (binding_p) gnat_pushlevel (); add_stmt_list (gnat_list); + if (binding_p) gnat_poplevel (); -- 2.30.2