public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <fortran@gcc.gnu.org>, <tobias@codesourcery.com>, <jakub@redhat.com>
Subject: [PATCH 3/5] OpenMP: Introduce C_ORT_{,OMP_}DECLARE_MAPPER c_omp_region_type types
Date: Thu, 10 Aug 2023 13:33:04 +0000	[thread overview]
Message-ID: <7f150aec826622376459cdecd2c870bc2e80d07b.1691672603.git.julian@codesourcery.com> (raw)
In-Reply-To: <cover.1691672603.git.julian@codesourcery.com>

This patch adds C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER
region types to the c_omp_region_type enum, and uses them in cp/pt.cc.
Previously the C_ORT_DECLARE_SIMD code was being abused to inhibit calling
finish_omp_clauses within mapper definitions, but this patch uses one
of the new enumeration values for that purpose instead.  This shouldn't
result in any behaviour change, but improves self-documentation.

2023-08-10  Julian Brown  <julian@codesourcery.com>

gcc/c-family/
	* c-common.h (c_omp_region_type): Add C_ORT_DECLARE_MAPPER and
	C_ORT_OMP_DECLARE_MAPPER codes.

gcc/cp/
	* pt.cc (tsubst_omp_clauses): Use C_ORT_OMP_DECLARE_MAPPER.
	(tsubst_expr): Likewise.
---
 gcc/c-family/c-common.h | 2 ++
 gcc/cp/pt.cc            | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index c805c8b2f7e..079d1eaafaa 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1271,9 +1271,11 @@ enum c_omp_region_type
   C_ORT_DECLARE_SIMD		= 1 << 2,
   C_ORT_TARGET			= 1 << 3,
   C_ORT_EXIT_DATA		= 1 << 4,
+  C_ORT_DECLARE_MAPPER		= 1 << 6,
   C_ORT_OMP_DECLARE_SIMD	= C_ORT_OMP | C_ORT_DECLARE_SIMD,
   C_ORT_OMP_TARGET		= C_ORT_OMP | C_ORT_TARGET,
   C_ORT_OMP_EXIT_DATA		= C_ORT_OMP | C_ORT_EXIT_DATA,
+  C_ORT_OMP_DECLARE_MAPPER	= C_ORT_OMP | C_ORT_DECLARE_MAPPER,
   C_ORT_ACC_TARGET		= C_ORT_ACC | C_ORT_TARGET
 };
 
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index fb50c5ac48d..2794c0ebecb 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -18328,7 +18328,7 @@ tsubst_omp_clauses (tree clauses, enum c_omp_region_type ort,
     }
 
   new_clauses = nreverse (new_clauses);
-  if (ort != C_ORT_OMP_DECLARE_SIMD)
+  if (ort != C_ORT_OMP_DECLARE_SIMD && ort != C_ORT_OMP_DECLARE_MAPPER)
     {
       if (ort & C_ORT_OMP)
 	new_clauses = c_omp_instantiate_mappers (new_clauses, ort);
@@ -19905,7 +19905,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 	decl = tsubst (decl, args, complain, in_decl);
 	tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
 	tree clauses = OMP_DECLARE_MAPPER_CLAUSES (t);
-	clauses = tsubst_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD, args,
+	clauses = tsubst_omp_clauses (clauses, C_ORT_OMP_DECLARE_MAPPER, args,
 				      complain, in_decl);
 	TREE_TYPE (t) = type;
 	OMP_DECLARE_MAPPER_DECL (t) = decl;
-- 
2.25.1


  parent reply	other threads:[~2023-08-10 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 13:33 [PATCH 0/5] [og13] OpenMP: Implement 'declare mapper' for 'target update' directives Julian Brown
2023-08-10 13:33 ` [PATCH 1/5] OpenMP: Move Fortran 'declare mapper' instantiation code Julian Brown
2023-08-10 13:33 ` [PATCH 2/5] OpenMP: Reprocess expanded clauses after 'declare mapper' instantiation Julian Brown
2023-08-10 13:33 ` Julian Brown [this message]
2023-08-10 13:33 ` [PATCH 4/5] OpenMP: Look up 'declare mapper' definitions at resolution time not parse time Julian Brown
2023-08-10 13:33 ` [PATCH 5/5] OpenMP: Enable 'declare mapper' mappers for 'target update' directives Julian Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f150aec826622376459cdecd2c870bc2e80d07b.1691672603.git.julian@codesourcery.com \
    --to=julian@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).