diff --git a/flang/lib/parser/dump-parse-tree.h b/flang/lib/parser/dump-parse-tree.h index 10867fd45bb9..10fe66bdf724 100644 --- a/flang/lib/parser/dump-parse-tree.h +++ b/flang/lib/parser/dump-parse-tree.h @@ -473,9 +473,11 @@ public: NODE(parser::OmpClause, Simdlen) NODE(parser::OmpClause, ThreadLimit) NODE(parser::OmpClause, To) + NODE(parser::OmpClause, Link) NODE(parser::OmpClause, Uniform) NODE(parser::OmpClause, Untied) NODE(parser::OmpClause, UseDevicePtr) + NODE(parser::OmpClause, IsDevicePtr) NODE(parser, OmpDefaultClause) NODE_ENUM(parser::OmpDefaultClause, Type) NODE(parser, OmpDependClause) diff --git a/flang/lib/parser/openmp-grammar.h b/flang/lib/parser/openmp-grammar.h index 4cb7b87d5ff7..5e452750270f 100644 --- a/flang/lib/parser/openmp-grammar.h +++ b/flang/lib/parser/openmp-grammar.h @@ -211,10 +211,14 @@ TYPE_PARSER("DEFAULTMAP" >> parenthesized(scalarIntExpr))) || "TO" >> construct(construct( parenthesized(nonemptyList(designator)))) || + "LINK" >> construct(construct( + parenthesized(nonemptyList(designator)))) || "UNIFORM" >> construct(construct( parenthesized(nonemptyList(name)))) || "USE_DEVICE_PTR" >> construct(construct( parenthesized(nonemptyList(name)))) || + "IS_DEVICE_PTR" >> construct(construct( + parenthesized(nonemptyList(name)))) || "ALIGNED" >> construct(parenthesized(Parser{})) || "DEFAULT" >> diff --git a/flang/lib/parser/parse-tree.h b/flang/lib/parser/parse-tree.h index ddc20c767c69..cc414b6c1de0 100644 --- a/flang/lib/parser/parse-tree.h +++ b/flang/lib/parser/parse-tree.h @@ -3441,15 +3441,18 @@ struct OmpClause { WRAPPER_CLASS(Simdlen, ScalarIntConstantExpr); WRAPPER_CLASS(ThreadLimit, ScalarIntExpr); WRAPPER_CLASS(To, std::list); + WRAPPER_CLASS(Link, std::list); WRAPPER_CLASS(Uniform, std::list); WRAPPER_CLASS(UseDevicePtr, std::list); + WRAPPER_CLASS(IsDevicePtr, std::list); std::variant + ThreadLimit, To, Link, Uniform, UseDevicePtr, IsDevicePtr, + OmpAlignedClause, OmpDefaultClause, OmpDependClause, OmpIfClause, + OmpLinearClause, OmpMapClause, OmpProcBindClause, OmpReductionClause, + OmpScheduleClause> u; }; diff --git a/flang/lib/parser/unparse.cc b/flang/lib/parser/unparse.cc index 2afdbdd78379..4c03a79df436 100644 --- a/flang/lib/parser/unparse.cc +++ b/flang/lib/parser/unparse.cc @@ -1992,6 +1992,11 @@ public: Walk(x.v, ","); Put(")"); } + void Unparse(const OmpClause::Link &x) { + Word("LINK("); + Walk(x.v, ","); + Put(")"); + } void Unparse(const OmpClause::Uniform &x) { Word("UNIFORM("); Walk(x.v, ","); @@ -2002,6 +2007,11 @@ public: Walk(x.v, ","); Put(")"); } + void Unparse(const OmpClause::IsDevicePtr &x) { + Word("IS_DEVICE_PTR("); + Walk(x.v, ","); + Put(")"); + } void Unparse(const OmpLoopDirective &x) { std::visit( common::visitors{