summaryrefslogtreecommitdiff
path: root/flang/lib/parser/unparse.cc
diff options
context:
space:
mode:
authorpeter klausler <pklausler@nvidia.com>2018-06-18 11:03:43 -0700
committerpeter klausler <pklausler@nvidia.com>2018-06-18 11:05:17 -0700
commitb23701f7d04aeafafbca7b329006238144e6eb4d (patch)
tree006fd4a2ad1d209299c299a4b86caaeaf00cee80 /flang/lib/parser/unparse.cc
parentbe3b272f1eede0b1e204a84b1d5bde2fcbf1c05a (diff)
downloadllvm-b23701f7d04aeafafbca7b329006238144e6eb4d.tar.gz
[flang] Rearrange some facilities into a new lib/common.
Original-commit: flang-compiler/f18@279af1e817b1266dd57689e462272f8e29496798 Reviewed-on: https://github.com/flang-compiler/f18/pull/106
Diffstat (limited to 'flang/lib/parser/unparse.cc')
-rw-r--r--flang/lib/parser/unparse.cc249
1 files changed, 133 insertions, 116 deletions
diff --git a/flang/lib/parser/unparse.cc b/flang/lib/parser/unparse.cc
index 9481e7de14fe..935392bcbaf1 100644
--- a/flang/lib/parser/unparse.cc
+++ b/flang/lib/parser/unparse.cc
@@ -17,10 +17,10 @@
#include "unparse.h"
#include "characters.h"
-#include "idioms.h"
-#include "indirection.h"
#include "parse-tree-visitor.h"
#include "parse-tree.h"
+#include "../common/idioms.h"
+#include "../common/indirection.h"
#include <algorithm>
#include <cinttypes>
#include <cstddef>
@@ -129,9 +129,9 @@ public:
}
void Unparse(const KindSelector &x) { // R706
std::visit(
- visitors{[&](const ScalarIntConstantExpr &y) {
- Put('('), Word("KIND="), Walk(y), Put(')');
- },
+ common::visitors{[&](const ScalarIntConstantExpr &y) {
+ Put('('), Word("KIND="), Walk(y), Put(')');
+ },
[&](const KindSelector::StarSize &y) { Put('*'), Walk(y.v); }},
x.u);
}
@@ -157,16 +157,17 @@ public:
Walk(", LEN=", x.length), Put(')');
}
void Unparse(const LengthSelector &x) { // R722
- std::visit(visitors{[&](const TypeParamValue &y) {
- Put('('), Word("LEN="), Walk(y), Put(')');
- },
+ std::visit(common::visitors{[&](const TypeParamValue &y) {
+ Put('('), Word("LEN="), Walk(y), Put(')');
+ },
[&](const CharLength &y) { Put('*'), Walk(y); }},
x.u);
}
void Unparse(const CharLength &x) { // R723
- std::visit(
- visitors{[&](const TypeParamValue &y) { Put('('), Walk(y), Put(')'); },
- [&](const std::int64_t &y) { Walk(y); }},
+ std::visit(common::visitors{[&](const TypeParamValue &y) {
+ Put('('), Walk(y), Put(')');
+ },
+ [&](const std::int64_t &y) { Walk(y); }},
x.u);
}
void Unparse(const CharLiteralConstant &x) { // R724
@@ -235,7 +236,8 @@ public:
std::get<std::optional<Initialization>>(d.t);
return init.has_value() &&
std::holds_alternative<
- std::list<Indirection<DataStmtValue>>>(init->u);
+ std::list<common::Indirection<DataStmtValue>>>(
+ init->u);
}))) {
Put(" ::");
}
@@ -247,14 +249,15 @@ public:
void Unparse(const Pointer &x) { Word("POINTER"); }
void Unparse(const Contiguous &x) { Word("CONTIGUOUS"); }
void Before(const ComponentAttrSpec &x) {
- std::visit(visitors{[&](const CoarraySpec &) { Word("CODIMENSION["); },
- [&](const ComponentArraySpec &) { Word("DIMENSION("); },
- [](const auto &) {}},
+ std::visit(
+ common::visitors{[&](const CoarraySpec &) { Word("CODIMENSION["); },
+ [&](const ComponentArraySpec &) { Word("DIMENSION("); },
+ [](const auto &) {}},
x.u);
}
void Post(const ComponentAttrSpec &x) {
std::visit(
- visitors{[&](const CoarraySpec &) { Put(']'); },
+ common::visitors{[&](const CoarraySpec &) { Put(']'); },
[&](const ComponentArraySpec &) { Put(')'); }, [](const auto &) {}},
x.u);
}
@@ -266,9 +269,10 @@ public:
Walk(std::get<std::optional<Initialization>>(x.t));
}
void Unparse(const ComponentArraySpec &x) { // R740
- std::visit(
- visitors{[&](const std::list<ExplicitShapeSpec> &y) { Walk(y, ","); },
- [&](const DeferredShapeSpecList &y) { Walk(y); }},
+ std::visit(common::visitors{[&](const std::list<ExplicitShapeSpec> &y) {
+ Walk(y, ",");
+ },
+ [&](const DeferredShapeSpecList &y) { Walk(y); }},
x.u);
}
void Unparse(const ProcComponentDefStmt &x) { // R741
@@ -282,12 +286,13 @@ public:
}
void Unparse(const Pass &x) { Word("PASS"), Walk("(", x.v, ")"); }
void Unparse(const Initialization &x) { // R743 & R805
- std::visit(visitors{[&](const ConstantExpr &y) { Put(" = "), Walk(y); },
- [&](const NullInit &y) { Put(" => "), Walk(y); },
- [&](const InitialDataTarget &y) { Put(" => "), Walk(y); },
- [&](const std::list<Indirection<DataStmtValue>> &y) {
- Walk("/", y, ", ", "/");
- }},
+ std::visit(
+ common::visitors{[&](const ConstantExpr &y) { Put(" = "), Walk(y); },
+ [&](const NullInit &y) { Put(" => "), Walk(y); },
+ [&](const InitialDataTarget &y) { Put(" => "), Walk(y); },
+ [&](const std::list<common::Indirection<DataStmtValue>> &y) {
+ Walk("/", y, ", ", "/");
+ }},
x.u);
}
void Unparse(const PrivateStmt &x) { // R745
@@ -308,7 +313,7 @@ public:
}
void Unparse(const TypeBoundGenericStmt &x) { // R751
Word("GENERIC"), Walk(", ", std::get<std::optional<AccessSpec>>(x.t));
- Put(" :: "), Walk(std::get<Indirection<GenericSpec>>(x.t));
+ Put(" :: "), Walk(std::get<common::Indirection<GenericSpec>>(x.t));
Put(" => "), Walk(std::get<std::list<Name>>(x.t), ", ");
}
void Post(const BindAttr::Deferred &) { Word("DEFERRED"); } // R752
@@ -387,7 +392,8 @@ public:
Walk(dts), Walk(", ", attrs, ", ");
static const auto isInitializerOldStyle = [](const Initialization &i) {
- return std::holds_alternative<std::list<Indirection<DataStmtValue>>>(i.u);
+ return std::holds_alternative<
+ std::list<common::Indirection<DataStmtValue>>>(i.u);
};
static const auto hasAssignmentInitializer = [](const EntityDecl &d) {
// Does a declaration have a new-style =x initializer?
@@ -435,13 +441,14 @@ public:
Put(' '), Walk(std::get<std::list<EntityDecl>>(x.t), ", ");
}
void Before(const AttrSpec &x) { // R802
- std::visit(visitors{[&](const CoarraySpec &y) { Word("CODIMENSION["); },
- [&](const ArraySpec &y) { Word("DIMENSION("); },
- [](const auto &) {}},
+ std::visit(
+ common::visitors{[&](const CoarraySpec &y) { Word("CODIMENSION["); },
+ [&](const ArraySpec &y) { Word("DIMENSION("); },
+ [](const auto &) {}},
x.u);
}
void Post(const AttrSpec &x) {
- std::visit(visitors{[&](const CoarraySpec &y) { Put(']'); },
+ std::visit(common::visitors{[&](const CoarraySpec &y) { Put(']'); },
[&](const ArraySpec &y) { Put(')'); }, [](const auto &) {}},
x.u);
}
@@ -459,8 +466,9 @@ public:
Word("BIND(C"), Walk(", NAME=", x.v), Put(')');
}
void Unparse(const CoarraySpec &x) { // R809
- std::visit(visitors{[&](const DeferredCoshapeSpecList &y) { Walk(y); },
- [&](const ExplicitCoshapeSpec &y) { Walk(y); }},
+ std::visit(
+ common::visitors{[&](const DeferredCoshapeSpecList &y) { Walk(y); },
+ [&](const ExplicitCoshapeSpec &y) { Walk(y); }},
x.u);
}
void Unparse(const DeferredCoshapeSpecList &x) { // R810
@@ -480,13 +488,14 @@ public:
Walk(std::get<SpecificationExpr>(x.t));
}
void Unparse(const ArraySpec &x) { // R815
- std::visit(
- visitors{[&](const std::list<ExplicitShapeSpec> &y) { Walk(y, ","); },
- [&](const std::list<AssumedShapeSpec> &y) { Walk(y, ","); },
- [&](const DeferredShapeSpecList &y) { Walk(y); },
- [&](const AssumedSizeSpec &y) { Walk(y); },
- [&](const ImpliedShapeSpec &y) { Walk(y); },
- [&](const AssumedRankSpec &y) { Walk(y); }},
+ std::visit(common::visitors{[&](const std::list<ExplicitShapeSpec> &y) {
+ Walk(y, ",");
+ },
+ [&](const std::list<AssumedShapeSpec> &y) { Walk(y, ","); },
+ [&](const DeferredShapeSpecList &y) { Walk(y); },
+ [&](const AssumedSizeSpec &y) { Walk(y); },
+ [&](const ImpliedShapeSpec &y) { Walk(y); },
+ [&](const AssumedRankSpec &y) { Walk(y); }},
x.u);
}
void Post(const AssumedShapeSpec &) { Put(':'); } // R819
@@ -621,11 +630,12 @@ public:
}
void Unparse(const ImplicitStmt &x) { // R863
Word("IMPLICIT ");
- std::visit(
- visitors{[&](const std::list<ImplicitSpec> &y) { Walk(y, ", "); },
- [&](const std::list<ImplicitStmt::ImplicitNoneNameSpec> &y) {
- Word("NONE"), Walk(" (", y, ", ", ")");
- }},
+ std::visit(common::visitors{[&](const std::list<ImplicitSpec> &y) {
+ Walk(y, ", ");
+ },
+ [&](const std::list<ImplicitStmt::ImplicitNoneNameSpec> &y) {
+ Word("NONE"), Walk(" (", y, ", ", ")");
+ }},
x.u);
}
void Unparse(const ImplicitSpec &x) { // R864
@@ -732,7 +742,7 @@ public:
Walk(", ", std::get<std::list<AllocOpt>>(x.t), ", "), Put(')');
}
void Before(const AllocOpt &x) { // R928, R931
- std::visit(visitors{[&](const AllocOpt::Mold &) { Word("MOLD="); },
+ std::visit(common::visitors{[&](const AllocOpt::Mold &) { Word("MOLD="); },
[&](const AllocOpt::Source &) { Word("SOURCE="); },
[](const StatOrErrmsg &) {}},
x.u);
@@ -759,7 +769,7 @@ public:
Walk(", ", std::get<std::list<StatOrErrmsg>>(x.t), ", "), Put(')');
}
void Before(const StatOrErrmsg &x) { // R942 & R1165
- std::visit(visitors{[&](const StatVariable &) { Word("STAT="); },
+ std::visit(common::visitors{[&](const StatVariable &) { Word("STAT="); },
[&](const MsgVariable &) { Word("ERRMSG="); }},
x.u);
}
@@ -806,9 +816,9 @@ public:
void Unparse(const PointerAssignmentStmt &x) { // R1033, R1034, R1038
Walk(std::get<DataRef>(x.t));
std::visit(
- visitors{[&](const std::list<BoundsRemapping> &y) {
- Put('('), Walk(y), Put(')');
- },
+ common::visitors{[&](const std::list<BoundsRemapping> &y) {
+ Put('('), Walk(y), Put(')');
+ },
[&](const std::list<BoundsSpec> &y) { Walk("(", y, ", ", ")"); }},
std::get<PointerAssignmentStmt::Bounds>(x.t).u);
Put(" => "), Walk(std::get<Expr>(x.t));
@@ -841,7 +851,7 @@ public:
}
void Unparse(const ForallConstructStmt &x) { // R1051
Walk(std::get<std::optional<Name>>(x.t), ": ");
- Word("FORALL"), Walk(std::get<Indirection<ConcurrentHeader>>(x.t));
+ Word("FORALL"), Walk(std::get<common::Indirection<ConcurrentHeader>>(x.t));
Indent();
}
void Unparse(const EndForallStmt &x) { // R1054
@@ -906,9 +916,9 @@ public:
Word("DO "), Walk(std::get<std::optional<LoopControl>>(x.t));
}
void Unparse(const LoopControl &x) { // R1123
- std::visit(visitors{[&](const ScalarLogicalExpr &y) {
- Word("WHILE ("), Walk(y), Put(')');
- },
+ std::visit(common::visitors{[&](const ScalarLogicalExpr &y) {
+ Word("WHILE ("), Walk(y), Put(')');
+ },
[&](const auto &y) { Walk(y); }},
x.u);
}
@@ -973,9 +983,9 @@ public:
Outdent(), Word("END SELECT"), Walk(" ", x.v);
}
void Unparse(const CaseSelector &x) { // R1145
- std::visit(visitors{[&](const std::list<CaseValueRange> &y) {
- Put('('), Walk(y), Put(')');
- },
+ std::visit(common::visitors{[&](const std::list<CaseValueRange> &y) {
+ Put('('), Walk(y), Put(')');
+ },
[&](const Default &) { Word("DEFAULT"); }},
x.u);
}
@@ -989,9 +999,9 @@ public:
}
void Unparse(const SelectRankCaseStmt &x) { // R1150
Outdent(), Word("RANK ");
- std::visit(visitors{[&](const ScalarIntConstantExpr &y) {
- Put('('), Walk(y), Put(')');
- },
+ std::visit(common::visitors{[&](const ScalarIntConstantExpr &y) {
+ Put('('), Walk(y), Put(')');
+ },
[&](const Star &) { Put("(*)"); },
[&](const Default &) { Word("DEFAULT"); }},
std::get<SelectRankCaseStmt::Rank>(x.t).u);
@@ -1007,9 +1017,9 @@ public:
Walk(" ", std::get<std::optional<Name>>(x.t)), Indent();
}
void Unparse(const TypeGuardStmt::Guard &x) {
- std::visit(visitors{[&](const TypeSpec &y) {
- Word("TYPE IS ("), Walk(y), Put(')');
- },
+ std::visit(common::visitors{[&](const TypeSpec &y) {
+ Word("TYPE IS ("), Walk(y), Put(')');
+ },
[&](const DerivedTypeSpec &y) {
Word("CLASS IS ("), Walk(y), Put(')');
},
@@ -1058,8 +1068,9 @@ public:
Walk(", ", std::get<std::list<StatOrErrmsg>>(x.t), ", "), Put(')');
}
void Before(const EventWaitStmt::EventWaitSpec &x) { // R1173, R1174
- std::visit(visitors{[&](const ScalarIntExpr &x) { Word("UNTIL_COUNT="); },
- [](const StatOrErrmsg &) {}},
+ std::visit(
+ common::visitors{[&](const ScalarIntExpr &x) { Word("UNTIL_COUNT="); },
+ [](const StatOrErrmsg &) {}},
x.u);
}
void Unparse(const EventWaitStmt &x) { // R1170
@@ -1074,8 +1085,9 @@ public:
Put(')');
}
void Before(const FormTeamStmt::FormTeamSpec &x) { // R1176, R1177
- std::visit(visitors{[&](const ScalarIntExpr &x) { Word("NEW_INDEX="); },
- [](const StatOrErrmsg &) {}},
+ std::visit(
+ common::visitors{[&](const ScalarIntExpr &x) { Word("NEW_INDEX="); },
+ [](const StatOrErrmsg &) {}},
x.u);
}
void Unparse(const LockStmt &x) { // R1178
@@ -1084,9 +1096,10 @@ public:
Put(')');
}
void Before(const LockStmt::LockStat &x) { // R1179
- std::visit(
- visitors{[&](const ScalarLogicalVariable &) { Word("ACQUIRED_LOCK="); },
- [](const StatOrErrmsg &y) {}},
+ std::visit(common::visitors{[&](const ScalarLogicalVariable &) {
+ Word("ACQUIRED_LOCK=");
+ },
+ [](const StatOrErrmsg &y) {}},
x.u);
}
void Unparse(const UnlockStmt &x) { // R1180
@@ -1099,10 +1112,10 @@ public:
Word("OPEN ("), Walk(x.v, ", "), Put(')');
}
bool Pre(const ConnectSpec &x) { // R1205
- return std::visit(visitors{[&](const FileUnitNumber &) {
- Word("UNIT=");
- return true;
- },
+ return std::visit(common::visitors{[&](const FileUnitNumber &) {
+ Word("UNIT=");
+ return true;
+ },
[&](const FileNameExpr &) {
Word("FILE=");
return true;
@@ -1141,7 +1154,7 @@ public:
Word("CLOSE ("), Walk(x.v, ", "), Put(')');
}
void Before(const CloseStmt::CloseSpec &x) { // R1209
- std::visit(visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
+ std::visit(common::visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
[&](const StatVariable &) { Word("IOSTAT="); },
[&](const MsgVariable &) { Word("IOMSG="); },
[&](const ErrLabel &) { Word("ERR="); },
@@ -1185,10 +1198,10 @@ public:
Walk(", ", std::get<std::list<OutputItem>>(x.t), ", ");
}
bool Pre(const IoControlSpec &x) { // R1213
- return std::visit(visitors{[&](const IoUnit &) {
- Word("UNIT=");
- return true;
- },
+ return std::visit(common::visitors{[&](const IoUnit &) {
+ Word("UNIT=");
+ return true;
+ },
[&](const Format &) {
Word("FMT=");
return true;
@@ -1255,7 +1268,7 @@ public:
Word("WAIT ("), Walk(x.v, ", "), Put(')');
}
void Before(const WaitSpec &x) { // R1223
- std::visit(visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
+ std::visit(common::visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
[&](const EndLabel &) { Word("END="); },
[&](const EorLabel &) { Word("EOR="); },
[&](const ErrLabel &) { Word("ERR="); },
@@ -1274,7 +1287,7 @@ public:
Word("REWIND ("), Walk(x.v, ", "), Put(')');
}
void Before(const PositionOrFlushSpec &x) { // R1227 & R1229
- std::visit(visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
+ std::visit(common::visitors{[&](const FileUnitNumber &) { Word("UNIT="); },
[&](const MsgVariable &) { Word("IOMSG="); },
[&](const StatVariable &) { Word("IOSTAT="); },
[&](const ErrLabel &) { Word("ERR="); }},
@@ -1286,17 +1299,17 @@ public:
void Unparse(const InquireStmt &x) { // R1230
Word("INQUIRE (");
std::visit(
- visitors{[&](const InquireStmt::Iolength &y) {
- Word("IOLENGTH="), Walk(y.t, ") ");
- },
+ common::visitors{[&](const InquireStmt::Iolength &y) {
+ Word("IOLENGTH="), Walk(y.t, ") ");
+ },
[&](const std::list<InquireSpec> &y) { Walk(y, ", "), Put(')'); }},
x.u);
}
bool Pre(const InquireSpec &x) { // R1231
- return std::visit(visitors{[&](const FileUnitNumber &) {
- Word("UNIT=");
- return true;
- },
+ return std::visit(common::visitors{[&](const FileUnitNumber &) {
+ Word("UNIT=");
+ return true;
+ },
[&](const FileNameExpr &) {
Word("FILE=");
return true;
@@ -1335,7 +1348,7 @@ public:
if (x.repeatCount.has_value()) {
Walk(*x.repeatCount);
}
- std::visit(visitors{[&](const std::string &y) { PutQuoted(y); },
+ std::visit(common::visitors{[&](const std::string &y) { PutQuoted(y); },
[&](const std::list<format::FormatItem> &y) {
Walk("(", y, ",", ")");
},
@@ -1443,15 +1456,17 @@ public:
void Unparse(const UseStmt &x) { // R1409
Word("USE"), Walk(", ", x.nature), Put(" :: "), Walk(x.moduleName);
std::visit(
- visitors{[&](const std::list<Rename> &y) { Walk(", ", y, ", "); },
+ common::visitors{
+ [&](const std::list<Rename> &y) { Walk(", ", y, ", "); },
[&](const std::list<Only> &y) { Walk(", ONLY: ", y, ", "); }},
x.u);
}
void Unparse(const Rename &x) { // R1411
- std::visit(visitors{[&](const Rename::Names &y) { Walk(y.t, " => "); },
- [&](const Rename::Operators &y) {
- Word("OPERATOR("), Walk(y.t, ") => OPERATOR("), Put(")");
- }},
+ std::visit(
+ common::visitors{[&](const Rename::Names &y) { Walk(y.t, " => "); },
+ [&](const Rename::Operators &y) {
+ Word("OPERATOR("), Walk(y.t, ") => OPERATOR("), Put(")");
+ }},
x.u);
}
void Before(const SubmoduleStmt &x) { // R1417
@@ -1471,9 +1486,9 @@ public:
}
void Unparse(const InterfaceStmt &x) { // R1503
- std::visit(visitors{[&](const std::optional<GenericSpec> &y) {
- Word("INTERFACE"), Walk(" ", y);
- },
+ std::visit(common::visitors{[&](const std::optional<GenericSpec> &y) {
+ Word("INTERFACE"), Walk(" ", y);
+ },
[&](const Abstract &) { Word("ABSTRACT INTERFACE"); }},
x.u);
Indent();
@@ -1491,7 +1506,7 @@ public:
}
void Before(const GenericSpec &x) { // R1508, R1509
std::visit(
- visitors{[&](const DefinedOperator &x) { Word("OPERATOR("); },
+ common::visitors{[&](const DefinedOperator &x) { Word("OPERATOR("); },
[&](const GenericSpec::Assignment &) { Word("ASSIGNMENT(=)"); },
[&](const GenericSpec::ReadFormatted &) {
Word("READ(FORMATTED)");
@@ -1509,7 +1524,7 @@ public:
x.u);
}
void Post(const GenericSpec &x) {
- std::visit(visitors{[&](const DefinedOperator &x) { Put(')'); },
+ std::visit(common::visitors{[&](const DefinedOperator &x) { Put(')'); },
[](const auto &) {}},
x.u);
}
@@ -1629,10 +1644,11 @@ public:
// Directives, extensions, and deprecated constructs
void Unparse(const CompilerDirective &x) {
std::visit(
- visitors{[&](const std::list<CompilerDirective::IgnoreTKR> &tkr) {
- Word("!DIR$ IGNORE_TKR");
- Walk(" ", tkr, ", ");
- },
+ common::visitors{
+ [&](const std::list<CompilerDirective::IgnoreTKR> &tkr) {
+ Word("!DIR$ IGNORE_TKR");
+ Walk(" ", tkr, ", ");
+ },
[&](const CompilerDirective::IVDEP &) { Word("!DIR$ IVDEP\n"); }},
x.u);
Put('\n');
@@ -1713,7 +1729,7 @@ public:
Put(")");
}
void Unparse(const OmpDependSinkVecLength &x) {
- Walk(std::get<Indirection<DefinedOperator>>(x.t));
+ Walk(std::get<common::Indirection<DefinedOperator>>(x.t));
Walk(std::get<ScalarIntConstantExpr>(x.t));
}
void Unparse(const OmpDependSinkVec &x) {
@@ -1726,9 +1742,9 @@ public:
Walk(std::get<std::list<Designator>>(x.t), ",");
}
void Unparse(const OmpDependClause &x) {
- std::visit(visitors{[&](const OmpDependClause::Source &y) {
- Word("DEPEND(SOURCE)");
- },
+ std::visit(common::visitors{[&](const OmpDependClause::Source &y) {
+ Word("DEPEND(SOURCE)");
+ },
[&](const OmpDependClause::Sink &y) {
Word("DEPEND(SINK:");
Walk(y.v);
@@ -1871,10 +1887,11 @@ public:
}
void Unparse(const OmpLoopDirective &x) {
std::visit(
- visitors{[&](const OmpLoopDirective::DistributeParallelDoSimd &y) {
- Word("DISTRIBUTE PARALLEL DO SIMD ");
- Walk(y.v, " ");
- },
+ common::visitors{
+ [&](const OmpLoopDirective::DistributeParallelDoSimd &y) {
+ Word("DISTRIBUTE PARALLEL DO SIMD ");
+ Walk(y.v, " ");
+ },
[&](const OmpLoopDirective::DistributeParallelDo &y) {
Word("DISTRIBUTE PARALLEL DO ");
Walk(y.v, " ");
@@ -1965,10 +1982,10 @@ public:
Indent();
}
void Unparse(const OmpStandaloneDirective &x) {
- std::visit(visitors{[&](const OmpStandaloneDirective::Barrier &y) {
- Word("BARRIER ");
- Walk(y.v, " ");
- },
+ std::visit(common::visitors{[&](const OmpStandaloneDirective::Barrier &y) {
+ Word("BARRIER ");
+ Walk(y.v, " ");
+ },
[&](const OmpStandaloneDirective::CancellationPoint &y) {
Word("CANCELLATION POINT ");
Walk(y.v, " ");
@@ -2007,7 +2024,7 @@ public:
}
void Unparse(const OmpEndDirective &x) {
Outdent();
- std::visit(visitors{[&](const OmpLoopDirective &y) {
+ std::visit(common::visitors{[&](const OmpLoopDirective &y) {
Word("!$OMP END ");
Walk(y);
}},