]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Refactor handling of iterators
authorKwok Cheung Yeung <kcyeung@baylibre.com>
Wed, 16 Jul 2025 16:59:54 +0000 (17:59 +0100)
committerKwok Cheung Yeung <kcyeung@baylibre.com>
Wed, 16 Jul 2025 18:38:23 +0000 (19:38 +0100)
commit7f8742ca479b326eb8a25bd2501cb14d7d09a83a
tree8875b5f37ec560850b3be171266339e09ec18c42
parent11f73c82f178beb9f3f29cbfe2e0a5e592e40b69
openmp: Refactor handling of iterators

Move code to calculate the iteration size and to generate the iterator
expansion loop into separate functions.

Use OMP_ITERATOR_DECL_P to check for iterators in clause declarations.

gcc/c-family/

* c-omp.cc (c_finish_omp_depobj): Use OMP_ITERATOR_DECL_P.

gcc/c/

* c-typeck.cc (handle_omp_array_sections): Use OMP_ITERATOR_DECL_P.
(c_finish_omp_clauses): Likewise.

gcc/cp/

* pt.cc (tsubst_omp_clause_decl): Use OMP_ITERATOR_DECL_P.
* semantics.cc (handle_omp_array_sections): Likewise.
(finish_omp_clauses): Likewise.

gcc/

* gimplify.cc (gimplify_omp_affinity): Use OMP_ITERATOR_DECL_P.
(compute_omp_iterator_count): New.
(build_omp_iterator_loop): New.
(gimplify_omp_depend): Use OMP_ITERATOR_DECL_P,
compute_omp_iterator_count and build_omp_iterator_loop.
* tree-inline.cc (copy_tree_body_r): Use OMP_ITERATOR_DECL_P.
* tree-pretty-print.cc (dump_omp_clause): Likewise.
* tree.h (OMP_ITERATOR_DECL_P): New macro.
gcc/c-family/c-omp.cc
gcc/c/c-typeck.cc
gcc/cp/pt.cc
gcc/cp/semantics.cc
gcc/gimplify.cc
gcc/tree-inline.cc
gcc/tree-pretty-print.cc
gcc/tree.h