]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Fortran "!$omp declare mapper" parser support
authorJulian Brown <julian@codesourcery.com>
Tue, 19 May 2026 19:25:54 +0000 (21:25 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Tue, 19 May 2026 19:25:54 +0000 (21:25 +0200)
commitcf6ef1219e488b0fbfa32508237a682bc34d5bff
treeac89df03898078890a8e1ac56714b8a5fa2155cf
parent573b66baa6cb8d38771b864d40a42ca2401ac5b9
OpenMP: Fortran "!$omp declare mapper" parser support

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (show_attr): Show omp_udm_artificial_var flag.
(show_omp_namelist): Support OMP_MAP_UNSET.
* gfortran.h (enum gfc_statement): Add ST_OMP_DECLARE_MAPPER.
(symbol_attribute): Add omp_udm_artificial_var attribute.
(enum gfc_omp_map_op): Add OMP_MAP_UNSET.
(gfc_omp_namelist_udm): New struct.
(gfc_omp_namelist): Add udm pointer to u2 union.
(gfc_symtree): Add omp_udm pointer.
(gfc_namespace): Add omp_udm_root symtree and omp_udm_ns flag.
(gfc_free_omp_udm, gfc_omp_udm_find, gfc_find_omp_udm,
gfc_resolve_omp_udms): Add prototypes.
* match.h (gfc_match_omp_declare_mapper): Add prototype.
* match.cc (gfc_free_omp_namelist): Update for declare mapper's udm.
* openmp.cc (gfc_omp_directives): Uncomment 'declare mapper'.
(gfc_free_omp_udm, gfc_find_omp_udm, gfc_omp_udm_find,
gfc_match_omp_declare_mapper, gfc_resolve_omp_udm,
gfc_resolve_omp_udms): New.
(gfc_match_omp_clauses): Take argument for the default map-type
modifier; add support for the 'mapper' modifier.
(resolve_omp_clauses): Update for declare-mapper map clauses.
* parse.cc (decode_omp_directive): Add declare mapper support.
(case_omp_decl): Add ST_OMP_DECLARE_MAPPER case.
(gfc_ascii_statement): Add ST_OMP_DECLARE_MAPPER case.
* resolve.cc (resolve_types): Call gfc_resolve_omp_udms.
* symbol.cc (free_omp_udm_tree): New function.
(gfc_free_namespace): Call it.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/declare-mapper-1.f90: New test.
* gfortran.dg/gomp/declare-mapper-2.f90: New test.

Co-Authored-By: Tobias Burnus <tburnus@baylibre.com>
gcc/fortran/dump-parse-tree.cc
gcc/fortran/gfortran.h
gcc/fortran/match.cc
gcc/fortran/match.h
gcc/fortran/openmp.cc
gcc/fortran/parse.cc
gcc/fortran/resolve.cc
gcc/fortran/symbol.cc
gcc/testsuite/gfortran.dg/gomp/declare-mapper-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/declare-mapper-2.f90 [new file with mode: 0644]