Rename PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE (was: Clarify PRAGMA_OACC_* and PRAGMA_OMP_*)
Thomas Schwinge
thomas@codesourcery.com
Wed Jun 29 09:20:00 GMT 2016
Hi!
On Tue, 28 Jun 2016 14:20:26 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Jun 28, 2016 at 02:13:24PM +0200, Thomas Schwinge wrote:
> > Looking at how OpenMP declare simd is handled in the C++ front end, I ran
> > into it being parsed for PRAGMA_OMP_DECLARE_REDUCTION, which got me
> > confused. OK to commit the following to un-confuse this, in that
> > PRAGMA_OACC_* and PRAGMA_OMP_* don't describe what *eventually* is to be
> > parsed (which (nowadays?) is wrong for PRAGMA_OMP_DECLARE_REDUCTION,
> > anyway), but instead they describe what *so far* has been parsed.
>
> I think I'd prefer if anything just to change PRAGMA_OMP_DECLARE_REDUCTION
> to PRAGMA_OMP_DECLARE (as the only case where there is any ambiguity) and
> nothing else, the rest would be more confusing than it is now.
I anticipated that you would say something along these lines... Thanks
at least for permitting to clarify PRAGMA_OMP_DECLARE_REDUCTION.
> > commit fa557f6ad39992052decb413501c713db8ec59f0
> > Author: Thomas Schwinge <thomas@codesourcery.com>
> > Date: Tue Jun 28 14:12:23 2016 +0200
> >
> > Clarify PRAGMA_OACC_* and PRAGMA_OMP_*
> >
> > gcc/c-family/
> > * c-pragma.h (enum pragma_kind): Rename PRAGMA_OACC_ENTER_DATA to
> > PRAGMA_OACC_ENTER, PRAGMA_OACC_EXIT_DATA to PRAGMA_OACC_EXIT,
> > PRAGMA_OMP_CANCELLATION_POINT to PRAGMA_OMP_CANCELLATION,
> > PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE,
> > PRAGMA_OMP_END_DECLARE_TARGET to PRAGMA_OMP_END. Adjust all
> > users.
Committed in r237842:
commit a4dd89cbd9a89bf7b4544cf0576b3607a0a7f281
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Jun 29 09:07:52 2016 +0000
Rename PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE
gcc/c-family/
* c-pragma.h (enum pragma_kind): Rename
PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE. Adjust all
users.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237842 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/c-family/ChangeLog | 6 ++++++
gcc/c-family/c-pragma.c | 2 +-
gcc/c-family/c-pragma.h | 2 +-
gcc/c/c-parser.c | 4 ++--
gcc/cp/parser.c | 4 ++--
5 files changed, 12 insertions(+), 6 deletions(-)
diff --git gcc/c-family/ChangeLog gcc/c-family/ChangeLog
index d5b8395..679cb6b 100644
--- gcc/c-family/ChangeLog
+++ gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-29 Thomas Schwinge <thomas@codesourcery.com>
+
+ * c-pragma.h (enum pragma_kind): Rename
+ PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE. Adjust all
+ users.
+
2016-06-29 Richard Biener <rguenther@suse.de>
PR middle-end/71002
diff --git gcc/c-family/c-pragma.c gcc/c-family/c-pragma.c
index c73aa82..277bc56 100644
--- gcc/c-family/c-pragma.c
+++ gcc/c-family/c-pragma.c
@@ -1286,7 +1286,7 @@ static const struct omp_pragma_def omp_pragmas[] = {
{ "threadprivate", PRAGMA_OMP_THREADPRIVATE }
};
static const struct omp_pragma_def omp_pragmas_simd[] = {
- { "declare", PRAGMA_OMP_DECLARE_REDUCTION },
+ { "declare", PRAGMA_OMP_DECLARE },
{ "distribute", PRAGMA_OMP_DISTRIBUTE },
{ "for", PRAGMA_OMP_FOR },
{ "parallel", PRAGMA_OMP_PARALLEL },
diff --git gcc/c-family/c-pragma.h gcc/c-family/c-pragma.h
index 65f10db..6d9cb08 100644
--- gcc/c-family/c-pragma.h
+++ gcc/c-family/c-pragma.h
@@ -46,7 +46,7 @@ enum pragma_kind {
PRAGMA_OMP_CANCEL,
PRAGMA_OMP_CANCELLATION_POINT,
PRAGMA_OMP_CRITICAL,
- PRAGMA_OMP_DECLARE_REDUCTION,
+ PRAGMA_OMP_DECLARE,
PRAGMA_OMP_DISTRIBUTE,
PRAGMA_OMP_END_DECLARE_TARGET,
PRAGMA_OMP_FLUSH,
diff --git gcc/c/c-parser.c gcc/c/c-parser.c
index 7f491f1..1d2dac7 100644
--- gcc/c/c-parser.c
+++ gcc/c/c-parser.c
@@ -10215,7 +10215,7 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p)
c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
return false;
- case PRAGMA_OMP_DECLARE_REDUCTION:
+ case PRAGMA_OMP_DECLARE:
c_parser_omp_declare (parser, context);
return false;
@@ -16381,7 +16381,7 @@ c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context)
while (c_parser_next_token_is (parser, CPP_PRAGMA))
{
if (c_parser_peek_token (parser)->pragma_kind
- != PRAGMA_OMP_DECLARE_REDUCTION
+ != PRAGMA_OMP_DECLARE
|| c_parser_peek_2nd_token (parser)->type != CPP_NAME
|| strcmp (IDENTIFIER_POINTER
(c_parser_peek_2nd_token (parser)->value),
diff --git gcc/cp/parser.c gcc/cp/parser.c
index d1f06fd..739fca0 100644
--- gcc/cp/parser.c
+++ gcc/cp/parser.c
@@ -37203,7 +37203,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
parser->lexer->in_pragma = true;
id = cp_parser_pragma_kind (pragma_tok);
- if (id != PRAGMA_OMP_DECLARE_REDUCTION && id != PRAGMA_OACC_ROUTINE)
+ if (id != PRAGMA_OMP_DECLARE && id != PRAGMA_OACC_ROUTINE)
cp_ensure_no_omp_declare_simd (parser);
switch (id)
{
@@ -37310,7 +37310,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
cp_parser_omp_threadprivate (parser, pragma_tok);
return false;
- case PRAGMA_OMP_DECLARE_REDUCTION:
+ case PRAGMA_OMP_DECLARE:
cp_parser_omp_declare (parser, pragma_tok, context);
return false;
Grüße
Thomas
More information about the Gcc-patches
mailing list