From 64b04e4754bfe7bf718e5140fe1fd0ca50373c28 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 20 Jun 2020 01:18:53 -0700 Subject: [PATCH] Temporarily Revert "[flang][OpenMP] Enhance parser support for flush construct to OpenMP 5.0" as it's failing Semantics/omp-clause-validity01.f90. This reverts commit b32401464f4c9c9d43a3ddcb351cb6c7c713fdb4. --- flang/include/flang/Parser/dump-parse-tree.h | 2 -- flang/include/flang/Parser/parse-tree.h | 16 ++-------------- flang/lib/Parser/openmp-parsers.cpp | 16 +++------------- flang/lib/Parser/unparse.cpp | 18 ++---------------- flang/test/Semantics/omp-clause-validity01.f90 | 4 ---- 5 files changed, 7 insertions(+), 49 deletions(-) diff --git a/flang/include/flang/Parser/dump-parse-tree.h b/flang/include/flang/Parser/dump-parse-tree.h index e5f25c2..ad93fcd 100644 --- a/flang/include/flang/Parser/dump-parse-tree.h +++ b/flang/include/flang/Parser/dump-parse-tree.h @@ -520,8 +520,6 @@ public: NODE(parser, OpenMPDeclareReductionConstruct) NODE(parser, OpenMPDeclareSimdConstruct) NODE(parser, OpenMPDeclareTargetConstruct) - NODE(parser, OmpFlushMemoryClause) - NODE_ENUM(OmpFlushMemoryClause, FlushMemoryOrder) NODE(parser, OpenMPFlushConstruct) NODE(parser, OpenMPLoopConstruct) NODE(parser, OpenMPSimpleStandaloneConstruct) diff --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h index 8481a55..933638d 100644 --- a/flang/include/flang/Parser/parse-tree.h +++ b/flang/include/flang/Parser/parse-tree.h @@ -3718,23 +3718,11 @@ struct OpenMPCancelConstruct { std::tuple> t; }; -// 2.18.8 Flush Construct [OpenMP 5.0] -// memory-order-clause -> acq_rel -// release -// acquire -struct OmpFlushMemoryClause { - ENUM_CLASS(FlushMemoryOrder, AcqRel, Release, Acquire) - WRAPPER_CLASS_BOILERPLATE(OmpFlushMemoryClause, FlushMemoryOrder); - CharBlock source; -}; - -// 2.18.8 flush -> FLUSH [memory-order-clause] [(variable-name-list)] +// 2.13.7 flush -> FLUSH [(variable-name-list)] struct OpenMPFlushConstruct { TUPLE_CLASS_BOILERPLATE(OpenMPFlushConstruct); CharBlock source; - std::tuple, - std::optional> - t; + std::tuple> t; }; struct OmpSimpleStandaloneDirective { diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp index 9aa81a7..2d81f5a 100644 --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -298,19 +298,9 @@ TYPE_PARSER(sourced(construct( TYPE_PARSER(sourced(construct(verbatim("CANCEL"_tok), Parser{}, maybe("IF" >> parenthesized(scalarLogicalExpr))))) -// 2.18.8 Flush construct -// flush -> FLUSH [memory-order-clause] [(variable-name-list)] -// memory-order-clause -> acq_rel -// release -// acquire -TYPE_PARSER(sourced(construct( - "ACQ_REL" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::AcqRel) || - "RELEASE" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::Release) || - "ACQUIRE" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::Acquire)))) - -TYPE_PARSER(sourced(construct(verbatim("FLUSH"_tok), - maybe(Parser{}), - maybe(parenthesized(Parser{}))))) +// 2.13.7 Flush construct +TYPE_PARSER(sourced(construct( + verbatim("FLUSH"_tok), maybe(parenthesized(Parser{}))))) // Simple Standalone Directives TYPE_PARSER(sourced(construct(first( diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp index 5acac38..c2b5c28 100644 --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -2359,24 +2359,10 @@ public: Put("\n"); EndOpenMP(); } - void Unparse(const OmpFlushMemoryClause &x) { - switch (x.v) { - case OmpFlushMemoryClause::FlushMemoryOrder::AcqRel: - Word("ACQ_REL "); - break; - case OmpFlushMemoryClause::FlushMemoryOrder::Release: - Word("RELEASE "); - break; - case OmpFlushMemoryClause::FlushMemoryOrder::Acquire: - Word("ACQUIRE "); - break; - } - } void Unparse(const OpenMPFlushConstruct &x) { BeginOpenMP(); - Word("!$OMP FLUSH "); - Walk(std::get>(x.t)); - Walk(" (", std::get>(x.t), ")"); + Word("!$OMP FLUSH"); + Walk("(", std::get>(x.t), ")"); Put("\n"); EndOpenMP(); } diff --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90 index e3f43dc..06fd720 100644 --- a/flang/test/Semantics/omp-clause-validity01.f90 +++ b/flang/test/Semantics/omp-clause-validity01.f90 @@ -403,10 +403,6 @@ !ERROR: Internal: no symbol found for 'i' !$omp ordered depend(sink:i-1) !$omp flush (c) - !$omp flush acq_rel - !$omp flush release - !$omp flush acquire - !$omp flush release (c) !$omp cancel DO !$omp cancellation point parallel -- 2.7.4