On Fri, Mar 18, 2022 at 09:26:49AM -0700, Julian Brown wrote: > This patch changes the representation of OMP array sections in the > C++ front end to use the new OMP_ARRAY_SECTION tree code instead of a > TREE_LIST. This is important for "declare mapper" support, because the > array section representation may stick around longer (in "declare mapper" > definitions), and special-case handling TREE_LIST becomes necessary in > more places, which starts to become unwieldy. > > 2022-02-18 Julian Brown <jul...@codesourcery.com> > > gcc/c-family/ > * c-omp.cc (c_omp_split_clauses): Support OMP_ARRAY_SECTION. > > gcc/cp/ > * parser.cc (cp_parser_omp_var_list_no_open): Use OMP_ARRAY_SECTION > code instead of TREE_LIST to represent OpenMP array sections. > * pt.cc (tsubst_copy, tsubst_omp_clause_decl, tsubst_copy_and_build): > Add OMP_ARRAY_SECTION support. > * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections, > cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION > instead of TREE_LIST where appropriate. > * gimplify.cc (gimplify_expr): Ensure OMP_ARRAY_SECTION has been > processed out before gimplification.
THis is all a step towards the right direction, but we really do want to transition from uses of TREE_LIST to represent array sections to OMP_ARRAY_SECTION. For some clauses that do allow lvalue expressions that is a must, for the rest just a good cleanup even when the OMP_ARRAY_SECTION are created instead of TREE_LIST during the explicit array section parsing in OpenMP var list parsing. Jakub