diff --git a/flang/include/flang/Parser/dump-parse-tree.h b/flang/include/flang/Parser/dump-parse-tree.h --- a/flang/include/flang/Parser/dump-parse-tree.h +++ b/flang/include/flang/Parser/dump-parse-tree.h @@ -485,7 +485,6 @@ NODE_ENUM(OmpDependenceType, Type) NODE(parser, OmpDependSinkVec) NODE(parser, OmpDependSinkVecLength) - NODE(parser, OmpDistScheduleClause) NODE(parser, OmpEndAtomic) NODE(parser, OmpEndBlockDirective) NODE(parser, OmpEndCriticalDirective) diff --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h --- a/flang/include/flang/Parser/parse-tree.h +++ b/flang/include/flang/Parser/parse-tree.h @@ -3456,10 +3456,6 @@ std::variant u; }; -// dist_schedule clause does not fit in generic clause class for tablegen. -// Therefore it is declared separatly here. -WRAPPER_CLASS(OmpDistScheduleClause, std::optional); - // OpenMP Clauses struct OmpClause { UNION_CLASS_BOILERPLATE(OmpClause); 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 @@ -176,7 +176,7 @@ "DEVICE" >> construct(construct( parenthesized(scalarIntExpr))) || "DIST_SCHEDULE" >> - construct(construct( + construct(construct( parenthesized("STATIC" >> maybe("," >> scalarIntExpr)))) || "FINAL" >> construct(construct( parenthesized(scalarLogicalExpr))) || 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 @@ -2065,11 +2065,6 @@ std::get>(x.t)); Word(")"); } - void Unparse(const OmpDistScheduleClause &x) { - Word("DIST_SCHEDULE(STATIC"); - Walk(", ", x.v); - Put(")"); - } #define GEN_FLANG_CLAUSE_UNPARSE #include "llvm/Frontend/OpenMP/OMP.inc" void Unparse(const OmpLoopDirective &x) { 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 @@ -139,6 +139,7 @@ void Enter(const parser::OmpClause::Copyprivate &); void Enter(const parser::OmpClause::Default &); void Enter(const parser::OmpClause::Device &); + void Enter(const parser::OmpClause::DistSchedule &); void Enter(const parser::OmpClause::Final &); void Enter(const parser::OmpClause::Firstprivate &); void Enter(const parser::OmpClause::From &); @@ -179,7 +180,6 @@ void Enter(const parser::OmpAlignedClause &); void Enter(const parser::OmpDefaultmapClause &); void Enter(const parser::OmpDependClause &); - void Enter(const parser::OmpDistScheduleClause &); void Enter(const parser::OmpIfClause &); void Enter(const parser::OmpLinearClause &); void Enter(const parser::OmpMapClause &); 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 @@ -430,6 +430,7 @@ CHECK_SIMPLE_CLAUSE(Relaxed, OMPC_relaxed) CHECK_SIMPLE_CLAUSE(Hint, OMPC_hint) CHECK_SIMPLE_CLAUSE(ProcBind, OMPC_proc_bind) +CHECK_SIMPLE_CLAUSE(DistSchedule, OMPC_dist_schedule) CHECK_REQ_SCALAR_INT_CLAUSE(Allocator, OMPC_allocator) CHECK_REQ_SCALAR_INT_CLAUSE(Grainsize, OMPC_grainsize) @@ -493,7 +494,6 @@ } } // Following clauses have a seperate node in parse-tree.h. -CHECK_SIMPLE_PARSER_CLAUSE(OmpDistScheduleClause, OMPC_dist_schedule) CHECK_SIMPLE_PARSER_CLAUSE(OmpReductionClause, OMPC_reduction) // Atomic-clause CHECK_SIMPLE_PARSER_CLAUSE(OmpAtomicRead, OMPC_read) 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 @@ -204,7 +204,6 @@ } def OMPC_DistSchedule : Clause<"dist_schedule"> { let clangClass = "OMPDistScheduleClause"; - let flangClass = "OmpDistScheduleClause"; let flangClassValue = "ScalarIntExpr"; let isValueOptional = true; }