-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[flang][OpenMP] Parsing support for iterator modifiers in FROM and TO #114593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
3e45edc
4a6a93e
33dd438
755c039
a678a0f
bb686c6
db66226
b6afc4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2138,6 +2138,27 @@ class UnparseVisitor { | |
| Put(","); | ||
| Walk(std::get<std::optional<ScalarIntConstantExpr>>(x.t)); | ||
| } | ||
| void Unparse(const OmpFromClause &x) { | ||
| auto &expect = | ||
| std::get<std::optional<std::list<OmpFromClause::Expectation>>>(x.t); | ||
| auto &iter = std::get<std::optional<std::list<OmpIteratorModifier>>>(x.t); | ||
|
||
| bool needComma{false}; | ||
| if (expect) { | ||
| Walk(*expect); | ||
| needComma = true; | ||
| } | ||
| if (iter) { | ||
| if (needComma) { | ||
| Put(", "); | ||
| } | ||
| Walk(*iter); | ||
| needComma = true; | ||
| } | ||
| if (needComma) { | ||
| Put(": "); | ||
| } | ||
| Walk(std::get<OmpObjectList>(x.t)); | ||
| } | ||
| void Unparse(const OmpIfClause &x) { | ||
| Walk(std::get<std::optional<OmpIfClause::DirectiveNameModifier>>(x.t), ":"); | ||
| Walk(std::get<ScalarLogicalExpr>(x.t)); | ||
|
|
@@ -2241,6 +2262,27 @@ class UnparseVisitor { | |
| Walk(":", | ||
| std::get<std::optional<OmpDefaultmapClause::VariableCategory>>(x.t)); | ||
| } | ||
| void Unparse(const OmpToClause &x) { | ||
| auto &expect = | ||
| std::get<std::optional<std::list<OmpToClause::Expectation>>>(x.t); | ||
| auto &iter = std::get<std::optional<std::list<OmpIteratorModifier>>>(x.t); | ||
|
||
| bool needComma{false}; | ||
| if (expect) { | ||
| Walk(*expect); | ||
| needComma = true; | ||
| } | ||
| if (iter) { | ||
| if (needComma) { | ||
| Put(", "); | ||
| } | ||
| Walk(*iter); | ||
| needComma = true; | ||
| } | ||
| if (needComma) { | ||
| Put(": "); | ||
| } | ||
| Walk(std::get<OmpObjectList>(x.t)); | ||
| } | ||
| #define GEN_FLANG_CLAUSE_UNPARSE | ||
| #include "llvm/Frontend/OpenMP/OMP.inc" | ||
| void Unparse(const OmpLoopDirective &x) { | ||
|
|
@@ -2858,6 +2900,7 @@ class UnparseVisitor { | |
| WALK_NESTED_ENUM(OmpDeviceTypeClause, Type) // OMP DEVICE_TYPE | ||
| WALK_NESTED_ENUM( | ||
| OmpReductionClause, ReductionModifier) // OMP reduction-modifier | ||
| WALK_NESTED_ENUM(OmpFromClause, Expectation) // OMP motion-expectation | ||
| WALK_NESTED_ENUM(OmpIfClause, DirectiveNameModifier) // OMP directive-modifier | ||
| WALK_NESTED_ENUM(OmpCancelType, Type) // OMP cancel-type | ||
| WALK_NESTED_ENUM(OmpOrderClause, Type) // OMP order-type | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Braced initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.