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 b32401464f.
This commit is contained in:
Eric Christopher
2020-06-20 01:18:53 -07:00
parent 1f593f46f3
commit 64b04e4754
5 changed files with 7 additions and 49 deletions
@@ -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)
+2 -14
View File
@@ -3718,23 +3718,11 @@ struct OpenMPCancelConstruct {
std::tuple<Verbatim, OmpCancelType, std::optional<If>> 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<Verbatim, std::optional<OmpFlushMemoryClause>,
std::optional<OmpObjectList>>
t;
std::tuple<Verbatim, std::optional<OmpObjectList>> t;
};
struct OmpSimpleStandaloneDirective {
+3 -13
View File
@@ -298,19 +298,9 @@ TYPE_PARSER(sourced(construct<OpenMPCancellationPointConstruct>(
TYPE_PARSER(sourced(construct<OpenMPCancelConstruct>(verbatim("CANCEL"_tok),
Parser<OmpCancelType>{}, 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<OmpFlushMemoryClause>(
"ACQ_REL" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::AcqRel) ||
"RELEASE" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::Release) ||
"ACQUIRE" >> pure(OmpFlushMemoryClause::FlushMemoryOrder::Acquire))))
TYPE_PARSER(sourced(construct<OpenMPFlushConstruct>(verbatim("FLUSH"_tok),
maybe(Parser<OmpFlushMemoryClause>{}),
maybe(parenthesized(Parser<OmpObjectList>{})))))
// 2.13.7 Flush construct
TYPE_PARSER(sourced(construct<OpenMPFlushConstruct>(
verbatim("FLUSH"_tok), maybe(parenthesized(Parser<OmpObjectList>{})))))
// Simple Standalone Directives
TYPE_PARSER(sourced(construct<OmpSimpleStandaloneDirective>(first(
+2 -16
View File
@@ -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<std::optional<OmpFlushMemoryClause>>(x.t));
Walk(" (", std::get<std::optional<OmpObjectList>>(x.t), ")");
Word("!$OMP FLUSH");
Walk("(", std::get<std::optional<OmpObjectList>>(x.t), ")");
Put("\n");
EndOpenMP();
}
@@ -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