[flang-commits] [flang] [flang][OpenMP] Parsing support for map type modifiers (PR #111860)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Fri Oct 11 01:56:06 PDT 2024
================
@@ -2073,11 +2073,24 @@ class UnparseVisitor {
":");
Walk(std::get<OmpObjectList>(x.t));
}
- void Unparse(const OmpMapType::Always &) { Word("ALWAYS,"); }
void Unparse(const OmpMapClause &x) {
- Walk(std::get<std::optional<OmpMapType>>(x.t), ":");
+ auto &typeMod =
+ std::get<std::optional<std::list<OmpMapClause::TypeModifier>>>(x.t);
+ auto &type = std::get<std::optional<OmpMapClause::Type>>(x.t);
+ Walk(typeMod);
+ if (typeMod.has_value() && type.has_value())
+ Put(", ");
+ Walk(type);
+ if (typeMod.has_value() || type.has_value())
+ Put(": ");
Walk(std::get<OmpObjectList>(x.t));
}
+ void Unparse(const OmpMapClause::TypeModifier &x) {
+ if (x == OmpMapClause::TypeModifier::OmpxHold)
+ Word("OMPX_HOLD");
+ else
+ Word(OmpMapClause::EnumToString(x));
+ }
----------------
kiranchandramohan wrote:
Nit: Frontend code has braces almost always.
https://github.com/llvm/llvm-project/pull/111860
More information about the flang-commits
mailing list