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 @@ -218,8 +218,8 @@ parenthesized(Parser{}))) || "PROC_BIND" >> construct(construct( parenthesized(Parser{}))) || - "REDUCTION" >> - construct(parenthesized(Parser{})) || + "REDUCTION" >> construct(construct( + parenthesized(Parser{}))) || "TASK_REDUCTION" >> construct(construct( parenthesized(Parser{}))) || 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 @@ -2013,11 +2013,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) { Walk(std::get>(x.t)); 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 @@ -152,6 +152,7 @@ void Enter(const parser::OmpClause::Priority &); void Enter(const parser::OmpClause::Private &); void Enter(const parser::OmpClause::ProcBind &); + void Enter(const parser::OmpClause::Reduction &); void Enter(const parser::OmpClause::Safelen &); void Enter(const parser::OmpClause::Shared &); void Enter(const parser::OmpClause::Simdlen &); @@ -184,7 +185,6 @@ void Enter(const parser::OmpIfClause &); void Enter(const parser::OmpLinearClause &); void Enter(const parser::OmpMapClause &); - 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 @@ -419,6 +419,7 @@ CHECK_SIMPLE_CLAUSE(Nogroup, OMPC_nogroup) CHECK_SIMPLE_CLAUSE(Notinbranch, OMPC_notinbranch) CHECK_SIMPLE_CLAUSE(Nowait, OMPC_nowait) +CHECK_SIMPLE_CLAUSE(Reduction, OMPC_reduction) CHECK_SIMPLE_CLAUSE(TaskReduction, OMPC_task_reduction) CHECK_SIMPLE_CLAUSE(To, OMPC_to) CHECK_SIMPLE_CLAUSE(Uniform, OMPC_uniform) @@ -495,7 +496,6 @@ } } // Following clauses have a seperate node in parse-tree.h. -CHECK_SIMPLE_PARSER_CLAUSE(OmpReductionClause, OMPC_reduction) // Atomic-clause CHECK_SIMPLE_PARSER_CLAUSE(OmpAtomicRead, OMPC_read) CHECK_SIMPLE_PARSER_CLAUSE(OmpAtomicWrite, OMPC_write) 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 @@ -82,7 +82,7 @@ } def OMPC_Reduction : Clause<"reduction"> { let clangClass = "OMPReductionClause"; - let flangClass = "OmpReductionClause"; + let flangClassValue = "OmpReductionClause"; } def OMPC_Linear : Clause<"linear"> { let clangClass = "OMPLinearClause";