From e7279cc2eda2a0c50cff19ee4e02eea3d7808f68 Mon Sep 17 00:00:00 2001 From: Kwok Cheung Yeung Date: Tue, 14 Feb 2023 21:24:19 +0000 Subject: [PATCH] openmp: Add support for 'present' modifier in the Fortran parse tree dump 2023-02-14 Kwok Cheung Yeung gcc/fortran/ * dump-parse-tree.cc (show_omp_namelist): Display 'present' map modifier. (show_omp_clauses): Display 'present' motion modifier for 'to' and 'from' clauses. --- gcc/fortran/ChangeLog.omp | 7 +++++++ gcc/fortran/dump-parse-tree.cc | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index 44bc0ea1e2a..579d8ee7c97 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,10 @@ +2023-02-14 Kwok Cheung Yeung + + * dump-parse-tree.cc (show_omp_namelist): Display 'present' map + modifier. + (show_omp_clauses): Display 'present' motion modifier for 'to' + and 'from' clauses. + 2023-02-09 Kwok Cheung Yeung * gfortran.h (enum gfc_omp_map_op): Add entries with 'present' diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 4da4d813d1d..7dad3ac0307 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -1453,9 +1453,20 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n) case OMP_MAP_TO: fputs ("to:", dumpfile); break; case OMP_MAP_FROM: fputs ("from:", dumpfile); break; case OMP_MAP_TOFROM: fputs ("tofrom:", dumpfile); break; + case OMP_MAP_PRESENT_ALLOC: fputs ("present,alloc:", dumpfile); break; + case OMP_MAP_PRESENT_TO: fputs ("present,to:", dumpfile); break; + case OMP_MAP_PRESENT_FROM: fputs ("present,from:", dumpfile); break; + case OMP_MAP_PRESENT_TOFROM: + fputs ("present,tofrom:", dumpfile); break; case OMP_MAP_ALWAYS_TO: fputs ("always,to:", dumpfile); break; case OMP_MAP_ALWAYS_FROM: fputs ("always,from:", dumpfile); break; case OMP_MAP_ALWAYS_TOFROM: fputs ("always,tofrom:", dumpfile); break; + case OMP_MAP_ALWAYS_PRESENT_TO: + fputs ("always,present,to:", dumpfile); break; + case OMP_MAP_ALWAYS_PRESENT_FROM: + fputs ("always,present,from:", dumpfile); break; + case OMP_MAP_ALWAYS_PRESENT_TOFROM: + fputs ("always,present,tofrom:", dumpfile); break; case OMP_MAP_DELETE: fputs ("delete:", dumpfile); break; case OMP_MAP_RELEASE: fputs ("release:", dumpfile); break; default: break; @@ -1793,6 +1804,10 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses) fputs ("inscan, ", dumpfile); if (list_type == OMP_LIST_REDUCTION_TASK) fputs ("task, ", dumpfile); + if ((list_type == OMP_LIST_TO || list_type == OMP_LIST_FROM) + && omp_clauses->lists[list_type]->u.motion_modifier + == OMP_MOTION_PRESENT) + fputs ("present:", dumpfile); show_omp_namelist (list_type, omp_clauses->lists[list_type]); fputc (')', dumpfile); } -- 2.34.1