]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Refactor handling of iterators
authorKwok Cheung Yeung <kcyeung@baylibre.com>
Wed, 27 Nov 2024 21:49:12 +0000 (21:49 +0000)
committerKwok Cheung Yeung <kcyeung@baylibre.com>
Thu, 17 Apr 2025 22:29:34 +0000 (23:29 +0100)
commit76e5b71adb86c7861ae877c96546ba919c8c4e2a
tree22923da49c9ac5fd291c869a17faa8f5e1561cb4
parent77e9a05316b9b56e21086a3e22cc6eb313c2efa3
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.
12 files changed:
gcc/ChangeLog.omp
gcc/c-family/ChangeLog.omp
gcc/c-family/c-omp.cc
gcc/c/ChangeLog.omp
gcc/c/c-typeck.cc
gcc/cp/ChangeLog.omp
gcc/cp/pt.cc
gcc/cp/semantics.cc
gcc/gimplify.cc
gcc/tree-inline.cc
gcc/tree-pretty-print.cc
gcc/tree.h