[flang][openacc] Add parsing support for dim in gang clause

Add parsing supprot for dim in gang clause

Depends on D151971

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D151972
This commit is contained in:
Valentin Clement
2023-06-13 20:33:20 -07:00
parent e6d8598e13
commit 5923e46fce
10 changed files with 141 additions and 40 deletions

View File

@@ -1908,9 +1908,19 @@ public:
}
}
void Unparse(const AccClauseList &x) { Walk(" ", x.v, " "); }
void Unparse(const AccGangArgument &x) {
Walk("NUM:", std::get<std::optional<ScalarIntExpr>>(x.t));
Walk(", STATIC:", std::get<std::optional<AccSizeExpr>>(x.t));
void Unparse(const AccGangArgList &x) { Walk(x.v, ","); }
void Before(const AccSizeExpr &x) {
if (!x.v)
Put("*");
}
void Before(const AccGangArg &x) {
common::visit(common::visitors{
[&](const AccGangArg::Num &) { Word("NUM:"); },
[&](const AccGangArg::Dim &) { Word("DIM:"); },
[&](const AccGangArg::Static &) { Word("STATIC:"); },
[](const StatOrErrmsg &) {},
},
x.u);
}
void Unparse(const AccCollapseArg &x) {
const auto &force{std::get<bool>(x.t)};