[flang] Fix space in issue unparse.cc between directive and its first clause.

Original-commit: flang-compiler/f18@d9478c1a59
Reviewed-on: https://github.com/flang-compiler/f18/pull/96
Tree-same-pre-rewrite: false
This commit is contained in:
Hongyon Suauthai 2018-06-01 11:47:24 -07:00
parent 9914f221bd
commit e2c8c21390
1 changed files with 99 additions and 94 deletions

View File

@ -1715,15 +1715,15 @@ public:
} }
void Unparse(const OmpDependClause &x) { void Unparse(const OmpDependClause &x) {
std::visit(visitors{[&](const OmpDependClause::Source &y) { std::visit(visitors{[&](const OmpDependClause::Source &y) {
Word(" DEPEND(SOURCE)"); Word("DEPEND(SOURCE)");
}, },
[&](const OmpDependClause::Sink &y) { [&](const OmpDependClause::Sink &y) {
Word(" DEPEND(SINK:"); Word("DEPEND(SINK:");
Walk(y.v); Walk(y.v);
Put(")"); Put(")");
}, },
[&](const OmpDependClause::InOut &y) { [&](const OmpDependClause::InOut &y) {
Word(" DEPEND("); Word("DEPEND(");
Walk(y.t); Walk(y.t);
Put(")"); Put(")");
}}, }},
@ -1732,216 +1732,221 @@ public:
void Before(const OmpClause::Defaultmap &x) { void Before(const OmpClause::Defaultmap &x) {
Word(" DEFAULTMAP(TOFROM:SCALAR)"); Word(" DEFAULTMAP(TOFROM:SCALAR)");
} }
void Before(const OmpClause::Inbranch &x) { Word(" INBRANCH"); } void Before(const OmpClause::Inbranch &x) { Word("INBRANCH"); }
void Before(const OmpClause::Mergeable &x) { Word(" MERGEABLE"); } void Before(const OmpClause::Mergeable &x) { Word("MERGEABLE"); }
void Before(const OmpClause::Nogroup &x) { Word(" NOGROUP"); } void Before(const OmpClause::Nogroup &x) { Word("NOGROUP"); }
void Before(const OmpClause::Notinbranch &x) { Word(" NOTINBRANCH"); } void Before(const OmpClause::Notinbranch &x) { Word("NOTINBRANCH"); }
void Before(const OmpClause::Nowait &x) { Word(" NOWAIT"); } void Before(const OmpClause::Nowait &x) { Word("NOWAIT"); }
void Before(const OmpClause::Untied &x) { Word(" UNTIED"); } void Before(const OmpClause::Untied &x) { Word("UNTIED"); }
void Unparse(const OmpClause::Collapse &x) { void Unparse(const OmpClause::Collapse &x) {
Word(" COLLAPSE("); Word("COLLAPSE(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Copyin &x) { void Unparse(const OmpClause::Copyin &x) {
Word(" COPYIN("); Word("COPYIN(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Copyprivate &x) { void Unparse(const OmpClause::Copyprivate &x) {
Word(" COPYPRIVATE("); Word("COPYPRIVATE(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Device &x) { void Unparse(const OmpClause::Device &x) {
Word(" DEVICE("); Word("DEVICE(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::DistSchedule &x) { void Unparse(const OmpClause::DistSchedule &x) {
Word(" DIST_SCHEDULE(STATIC,"); Word("DIST_SCHEDULE(STATIC,");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Final &x) { void Unparse(const OmpClause::Final &x) {
Word(" FINAL("); Word("FINAL(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Firstprivate &x) { void Unparse(const OmpClause::Firstprivate &x) {
Word(" FIRSTPRIVATE("); Word("FIRSTPRIVATE(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::From &x) { void Unparse(const OmpClause::From &x) {
Word(" FROM("); Word("FROM(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Grainsize &x) { void Unparse(const OmpClause::Grainsize &x) {
Word(" GRAINSIZE("); Word("GRAINSIZE(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Lastprivate &x) { void Unparse(const OmpClause::Lastprivate &x) {
Word(" LASTPRIVATE("); Word("LASTPRIVATE(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Link &x) { void Unparse(const OmpClause::Link &x) {
Word(" LINK("); Word("LINK(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::NumTasks &x) { void Unparse(const OmpClause::NumTasks &x) {
Word(" NUM_TASKS("); Word("NUM_TASKS(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::NumTeams &x) { void Unparse(const OmpClause::NumTeams &x) {
Word(" NUM_TEAMS("); Word("NUM_TEAMS(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::NumThreads &x) { void Unparse(const OmpClause::NumThreads &x) {
Word(" NUM_THREADS("); Word("NUM_THREADS(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Ordered &x) { void Unparse(const OmpClause::Ordered &x) {
Word(" ORDERED"); Word("ORDERED");
Walk("(", x.v, ")"); Walk("(", x.v, ")");
} }
void Unparse(const OmpClause::Priority &x) { void Unparse(const OmpClause::Priority &x) {
Word(" PRIORITY("); Word("PRIORITY(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Private &x) { void Unparse(const OmpClause::Private &x) {
Word(" PRIVATE("); Word("PRIVATE(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Safelen &x) { void Unparse(const OmpClause::Safelen &x) {
Word(" SAFELEN("); Word("SAFELEN(");
Walk(x.v);
Put(")");
}
void Unparse(const OmpClause::Simdlen &x) {
Word("SIMDLEN(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::ThreadLimit &x) { void Unparse(const OmpClause::ThreadLimit &x) {
Word(" THREADLIMIT("); Word("THREADLIMIT(");
Walk(x.v); Walk(x.v);
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Shared &x) { void Unparse(const OmpClause::Shared &x) {
Word(" SHARED("); Word("SHARED(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::To &x) { void Unparse(const OmpClause::To &x) {
Word(" TO("); Word("TO(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::Uniform &x) { void Unparse(const OmpClause::Uniform &x) {
Word(" UNIFORM("); Word("UNIFORM(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpClause::UseDevicePtr &x) { void Unparse(const OmpClause::UseDevicePtr &x) {
Word(" USE_DEVICE_PTR("); Word("USE_DEVICE_PTR(");
Walk(x.v, ","); Walk(x.v, ",");
Put(")"); Put(")");
} }
void Unparse(const OmpLoopDirective &x) { void Unparse(const OmpLoopDirective &x) {
std::visit( std::visit(
visitors{[&](const OmpLoopDirective::DistributeParallelDoSimd &y) { visitors{[&](const OmpLoopDirective::DistributeParallelDoSimd &y) {
Word("DISTRIBUTE PARALLEL DO SIMD"); Word("DISTRIBUTE PARALLEL DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::DistributeParallelDo &y) { [&](const OmpLoopDirective::DistributeParallelDo &y) {
Word("DISTRIBUTE PARALLEL DO"); Word("DISTRIBUTE PARALLEL DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::DistributeSimd &y) { [&](const OmpLoopDirective::DistributeSimd &y) {
Word("DISTRIBUTE SIMD"); Word("DISTRIBUTE SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::Distribute &y) { [&](const OmpLoopDirective::Distribute &y) {
Word("DISTRIBUTE"); Word("DISTRIBUTE ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::DoSimd &y) { [&](const OmpLoopDirective::DoSimd &y) {
Word("DO SIMD"); Word("DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::Do &y) { [&](const OmpLoopDirective::Do &y) {
Word("DO"); Word("DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::ParallelDoSimd &y) { [&](const OmpLoopDirective::ParallelDoSimd &y) {
Word("PARALLEL DO SIMD"); Word("PARALLEL DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::ParallelDo &y) { [&](const OmpLoopDirective::ParallelDo &y) {
Word("PARALLEL DO"); Word("PARALLEL DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::Simd &y) { [&](const OmpLoopDirective::Simd &y) {
Word("SIMD"); Word("SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetParallelDoSimd &y) { [&](const OmpLoopDirective::TargetParallelDoSimd &y) {
Word("TARGET PARALLEL DO SIMD"); Word("TARGET PARALLEL DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetParallelDo &y) { [&](const OmpLoopDirective::TargetParallelDo &y) {
Word("TARGET PARALLEL DO"); Word("TARGET PARALLEL DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetTeamsDistributeParallelDoSimd [&](const OmpLoopDirective::TargetTeamsDistributeParallelDoSimd
&y) { &y) {
Word("TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD"); Word("TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetTeamsDistributeParallelDo &y) { [&](const OmpLoopDirective::TargetTeamsDistributeParallelDo &y) {
Word("TARGET TEAMS DISTRIBUTE PARALLEL DO"); Word("TARGET TEAMS DISTRIBUTE PARALLEL DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetTeamsDistributeSimd &y) { [&](const OmpLoopDirective::TargetTeamsDistributeSimd &y) {
Word("TARGET TEAMS DISTRIBUTE SIMD"); Word("TARGET TEAMS DISTRIBUTE SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetTeamsDistribute &y) { [&](const OmpLoopDirective::TargetTeamsDistribute &y) {
Word("TARGET TEAMS DISTRIBUTE"); Word("TARGET TEAMS DISTRIBUTE ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TargetSimd &y) { [&](const OmpLoopDirective::TargetSimd &y) {
Word("TARGET SIMD"); Word("TARGET SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TaskloopSimd &y) { [&](const OmpLoopDirective::TaskloopSimd &y) {
Word("TASKLOOP SIMD"); Word("TASKLOOP SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::Taskloop &y) { [&](const OmpLoopDirective::Taskloop &y) {
Word("TASKLOOP"); Word("TASKLOOP ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TeamsDistributeParallelDoSimd &y) { [&](const OmpLoopDirective::TeamsDistributeParallelDoSimd &y) {
Word("TEAMS DISTRIBUTE PARALLEL DO SIMD"); Word("TEAMS DISTRIBUTE PARALLEL DO SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TeamsDistributeParallelDo &y) { [&](const OmpLoopDirective::TeamsDistributeParallelDo &y) {
Word("TEAMS DISTRIBUTE PARALLEL DO"); Word("TEAMS DISTRIBUTE PARALLEL DO ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TeamsDistributeSimd &y) { [&](const OmpLoopDirective::TeamsDistributeSimd &y) {
Word("TEAMS DISTRIBUTE SIMD"); Word("TEAMS DISTRIBUTE SIMD ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpLoopDirective::TeamsDistribute &y) { [&](const OmpLoopDirective::TeamsDistribute &y) {
Word("TEAMS DISTRIBUTE"); Word("TEAMS DISTRIBUTE ");
Walk(y.v); Walk(y.v, " ");
}}, }},
x.u); x.u);
Put("\n"); Put("\n");
@ -1949,40 +1954,40 @@ public:
} }
void Unparse(const OmpStandaloneDirective &x) { void Unparse(const OmpStandaloneDirective &x) {
std::visit(visitors{[&](const OmpStandaloneDirective::Barrier &y) { std::visit(visitors{[&](const OmpStandaloneDirective::Barrier &y) {
Word("BARRIER"); Word("BARRIER ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::CancellationPoint &y) { [&](const OmpStandaloneDirective::CancellationPoint &y) {
Word("CANCELLATION POINT"); Word("CANCELLATION POINT ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::Cancel &y) { [&](const OmpStandaloneDirective::Cancel &y) {
Word("CANCEL"); Word("CANCEL ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::Flush &y) { [&](const OmpStandaloneDirective::Flush &y) {
Word("FLUSH"); Word("FLUSH ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::TargetEnterData &y) { [&](const OmpStandaloneDirective::TargetEnterData &y) {
Word("TARGET ENTER DATA"); Word("TARGET ENTER DATA ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::TargetExitData &y) { [&](const OmpStandaloneDirective::TargetExitData &y) {
Word("TARGET EXIT DATA"); Word("TARGET EXIT DATA ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::TargetUpdate &y) { [&](const OmpStandaloneDirective::TargetUpdate &y) {
Word("TARGET UPDATE"); Word("TARGET UPDATE ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::Taskwait &y) { [&](const OmpStandaloneDirective::Taskwait &y) {
Word("TASKWAIT"); Word("TASKWAIT ");
Walk(y.v); Walk(y.v, " ");
}, },
[&](const OmpStandaloneDirective::Taskyield &y) { [&](const OmpStandaloneDirective::Taskyield &y) {
Word("TASKYIELD"); Word("TASKYIELD ");
Walk(y.v); Walk(y.v, " ");
}}, }},
x.u); x.u);
Put("\n"); Put("\n");