diff options
author | Kwok Cheung Yeung <kcyeung@baylibre.com> | 2025-01-13 13:08:07 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2025-05-15 20:25:53 +0000 |
commit | 752ef8f4f5ddf9a3372e6d5dc08df6aa05a60ea3 (patch) | |
tree | b1b7c411ed2e11908955f8265441ac8f755d1905 /gcc/c | |
parent | bb8a5a0783a209512e8d814b4307e910fe141377 (diff) | |
download | gcc-752ef8f4f5ddf9a3372e6d5dc08df6aa05a60ea3.zip gcc-752ef8f4f5ddf9a3372e6d5dc08df6aa05a60ea3.tar.gz gcc-752ef8f4f5ddf9a3372e6d5dc08df6aa05a60ea3.tar.bz2 |
openmp: Add support for using custom mappers with iterators (C, C++)
gcc/c-family/
* c-omp.cc (omp_instantiate_mapper): Apply iterator to new clauses
generated from mapper.
gcc/c/
* c-parser.cc (c_parser_omp_clause_map): Apply iterator to push and
pop mapper clauses.
gcc/cp/
* parser.cc (cp_parser_omp_clause_map): Apply iterator to push and
pop mapper clauses.
* semantics.cc (cxx_omp_map_array_section): Allow array types for
base type of array sections.
libgomp/
* testsuite/libgomp.c-c++-common/mapper-iterators-1.c: New test.
* testsuite/libgomp.c-c++-common/mapper-iterators-2.c: New test.
* testsuite/libgomp.c-c++-common/mapper-iterators-3.c: New test.
Co-authored-by: Andrew Stubbs <ams@baylibre.com>
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/c-parser.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index 8a5b493..31ab7d0 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -20738,6 +20738,8 @@ c_parser_omp_clause_map (c_parser *parser, tree list, enum gomp_map_kind kind) tree name = build_omp_clause (input_location, OMP_CLAUSE_MAP); OMP_CLAUSE_SET_MAP_KIND (name, GOMP_MAP_PUSH_MAPPER_NAME); OMP_CLAUSE_DECL (name) = mapper_name; + if (iterators) + OMP_CLAUSE_ITERATORS (name) = iterators; OMP_CLAUSE_CHAIN (name) = nl; nl = name; @@ -20746,6 +20748,8 @@ c_parser_omp_clause_map (c_parser *parser, tree list, enum gomp_map_kind kind) name = build_omp_clause (input_location, OMP_CLAUSE_MAP); OMP_CLAUSE_SET_MAP_KIND (name, GOMP_MAP_POP_MAPPER_NAME); OMP_CLAUSE_DECL (name) = null_pointer_node; + if (iterators) + OMP_CLAUSE_ITERATORS (name) = iterators; OMP_CLAUSE_CHAIN (name) = OMP_CLAUSE_CHAIN (last_new); OMP_CLAUSE_CHAIN (last_new) = name; } |