From ca3dc401a9fe69ae302b54078b71caf46dee77e2 Mon Sep 17 00:00:00 2001 From: Jinxin Yang Date: Thu, 11 Jul 2019 12:19:51 -0700 Subject: [PATCH] [flang] add ORDERED construct w/ THREADS and SIMD clauses (parse error) Original-commit: flang-compiler/f18@23a71aed74ee34ddd4dbf80ac3f906bf8c255bd9 Reviewed-on: https://github.com/flang-compiler/f18/pull/566 Tree-same-pre-rewrite: false --- flang/lib/parser/dump-parse-tree.h | 2 ++ flang/lib/parser/openmp-grammar.h | 2 ++ flang/lib/parser/parse-tree.h | 10 ++++++---- flang/lib/parser/unparse.cc | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/flang/lib/parser/dump-parse-tree.h b/flang/lib/parser/dump-parse-tree.h index 9cb92f5..4aeb620 100644 --- a/flang/lib/parser/dump-parse-tree.h +++ b/flang/lib/parser/dump-parse-tree.h @@ -460,6 +460,8 @@ public: NODE(parser::OmpClause, Mergeable) NODE(parser::OmpClause, Nogroup) NODE(parser::OmpClause, Notinbranch) + NODE(parser::OmpClause, Threads) + NODE(parser::OmpClause, Simd) NODE(parser::OmpClause, NumTasks) NODE(parser::OmpClause, NumTeams) NODE(parser::OmpClause, NumThreads) diff --git a/flang/lib/parser/openmp-grammar.h b/flang/lib/parser/openmp-grammar.h index 5572d70..5f85ca8 100644 --- a/flang/lib/parser/openmp-grammar.h +++ b/flang/lib/parser/openmp-grammar.h @@ -166,6 +166,8 @@ TYPE_PARSER("DEFAULTMAP" >> "NOGROUP" >> construct(construct()) || "NOTINBRANCH" >> construct(construct()) || + "THREADS" >> construct(construct()) || + "SIMD" >> construct(construct()) || "NOWAIT" >> construct(construct()) || "UNTIED" >> construct(construct()) || "COLLAPSE" >> construct(construct( diff --git a/flang/lib/parser/parse-tree.h b/flang/lib/parser/parse-tree.h index 3d8acc6..be12995 100644 --- a/flang/lib/parser/parse-tree.h +++ b/flang/lib/parser/parse-tree.h @@ -3418,6 +3418,8 @@ struct OmpClause { EMPTY_CLASS(Nogroup); EMPTY_CLASS(Notinbranch); EMPTY_CLASS(Untied); + EMPTY_CLASS(Threads); + EMPTY_CLASS(Simd); WRAPPER_CLASS(Collapse, ScalarIntConstantExpr); WRAPPER_CLASS(Copyin, OmpObjectList); WRAPPER_CLASS(Copyprivate, OmpObjectList); @@ -3445,10 +3447,10 @@ struct OmpClause { WRAPPER_CLASS(IsDevicePtr, std::list); CharBlock source; std::variant diff --git a/flang/lib/parser/unparse.cc b/flang/lib/parser/unparse.cc index 0d1c311..70482f3 100644 --- a/flang/lib/parser/unparse.cc +++ b/flang/lib/parser/unparse.cc @@ -1861,6 +1861,8 @@ public: void Before(const OmpClause::Nogroup &x) { Word("NOGROUP"); } void Before(const OmpClause::Notinbranch &x) { Word("NOTINBRANCH"); } void Before(const OmpClause::Untied &x) { Word("UNTIED"); } + void Before(const OmpClause::Threads &x) { Word("THREADS"); } + void Before(const OmpClause::Simd &x) { Word("SIMD"); } void Unparse(const OmpNowait &) { Word("NOWAIT"); } void Unparse(const OmpClause::Collapse &x) { Word("COLLAPSE("); -- 2.7.4