aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-04-02 22:20:43 -0400
committerJason Merrill <jason@redhat.com>2021-05-28 09:33:11 -0400
commit0f54cc9c63842ddfa921530cb499743cafc9b177 (patch)
tree28795686ae6679df3a4961d97f4d71e8d87d3cd1 /gcc/gimplify.c
parentf7a07f5a5d8065e7f11133dd1f4ad3510ab2195b (diff)
downloadgcc-0f54cc9c63842ddfa921530cb499743cafc9b177.zip
gcc-0f54cc9c63842ddfa921530cb499743cafc9b177.tar.gz
gcc-0f54cc9c63842ddfa921530cb499743cafc9b177.tar.bz2
tree-iterator: C++11 range-for and tree_stmt_iterator
Like my recent patch to add ovl_range and lkp_range in the C++ front end, this patch adds the tsi_range adaptor for using C++11 range-based 'for' with a STATEMENT_LIST, e.g. for (tree stmt : tsi_range (stmt_list)) { ... } This also involves adding some operators to tree_stmt_iterator that are needed for range-for iterators, and should also be useful in code that uses the iterators directly. The patch updates the suitable loops in the C++ front end, but does not touch any loops elsewhere in the compiler. gcc/ChangeLog: * tree-iterator.h (struct tree_stmt_iterator): Add operator++, operator--, operator*, operator==, and operator!=. (class tsi_range): New. gcc/cp/ChangeLog: * constexpr.c (build_data_member_initialization): Use tsi_range. (build_constexpr_constructor_member_initializers): Likewise. (constexpr_fn_retval, cxx_eval_statement_list): Likewise. (potential_constant_expression_1): Likewise. * coroutines.cc (await_statement_expander): Likewise. (await_statement_walker): Likewise. * module.cc (trees_out::core_vals): Likewise. * pt.c (tsubst_expr): Likewise. * semantics.c (set_cleanup_locs): Likewise.
Diffstat (limited to 'gcc/gimplify.c')
0 files changed, 0 insertions, 0 deletions