diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -216,11 +216,11 @@ parenthesized(Parser{}))) || "PROC_BIND" >> construct(parenthesized(Parser{})) || - "REDUCTION" >> - construct(parenthesized(Parser{})) || + "REDUCTION" >> construct(construct( + parenthesized(Parser{}))) || "TASK_REDUCTION" >> construct(construct( - parenthesized(Parser{}))) || + parenthesized(Parser{}))) || "RELAXED" >> construct(construct()) || "RELEASE" >> construct(construct()) || "SAFELEN" >> construct(construct( diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -2004,11 +2004,9 @@ Put(")"); } void Unparse(const OmpReductionClause &x) { - Word("REDUCTION("); Walk(std::get(x.t)); Put(":"); Walk(std::get(x.t)); - Put(")"); } void Unparse(const OmpAllocateClause &x) { Word("ALLOCATE("); diff --git a/flang/lib/Semantics/check-omp-structure.h b/flang/lib/Semantics/check-omp-structure.h --- a/flang/lib/Semantics/check-omp-structure.h +++ b/flang/lib/Semantics/check-omp-structure.h @@ -141,6 +141,7 @@ void Enter(const parser::OmpClause::Ordered &); void Enter(const parser::OmpClause::Priority &); void Enter(const parser::OmpClause::Private &); + void Enter(const parser::OmpClause::Reduction &); void Enter(const parser::OmpClause::Safelen &); void Enter(const parser::OmpClause::Shared &); void Enter(const parser::OmpClause::Simdlen &); @@ -162,7 +163,6 @@ void Enter(const parser::OmpLinearClause &); void Enter(const parser::OmpMapClause &); void Enter(const parser::OmpProcBindClause &); - void Enter(const parser::OmpReductionClause &); void Enter(const parser::OmpScheduleClause &); private: diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -373,6 +373,7 @@ CHECK_SIMPLE_CLAUSE(Nogroup, OMPC_nogroup) CHECK_SIMPLE_CLAUSE(Notinbranch, OMPC_notinbranch) CHECK_SIMPLE_CLAUSE(Private, OMPC_private) +CHECK_SIMPLE_CLAUSE(Reduction, OMPC_reduction) CHECK_SIMPLE_CLAUSE(Shared, OMPC_shared) CHECK_SIMPLE_CLAUSE(TaskReduction, OMPC_task_reduction) CHECK_SIMPLE_CLAUSE(To, OMPC_to) @@ -414,8 +415,6 @@ CHECK_SIMPLE_PARSER_CLAUSE(OmpDistScheduleClause, OMPC_dist_schedule) CHECK_SIMPLE_PARSER_CLAUSE(OmpNowait, OMPC_nowait) CHECK_SIMPLE_PARSER_CLAUSE(OmpProcBindClause, OMPC_proc_bind) -CHECK_SIMPLE_PARSER_CLAUSE(OmpReductionClause, OMPC_reduction) - // Restrictions specific to each clause are implemented apart from the // generalized restrictions. diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td --- a/llvm/include/llvm/Frontend/OpenMP/OMP.td +++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td @@ -81,7 +81,7 @@ } def OMPC_Reduction : Clause<"reduction"> { let clangClass = "OMPReductionClause"; - let flangClass = "OmpReductionClause"; + let flangClassValue = "OmpReductionClause"; } def OMPC_Linear : Clause<"linear"> { let clangClass = "OMPLinearClause";