diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:31:57 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:33:27 +0900 |
commit | df025ebf872052c0761d44a3ef9b65e9675af8a8 (patch) | |
tree | 9b4e94583e2536546d6606270bcdf846c95e1ba2 /flang/lib/Parser/unparse.cpp | |
parent | 4428c9d0b1344179f85a72e183a44796976521e3 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/loop.zip llvm-users/chapuni/cov/single/loop.tar.gz llvm-users/chapuni/cov/single/loop.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/loopusers/chapuni/cov/single/loop
Conflicts:
clang/lib/CodeGen/CoverageMappingGen.cpp
Diffstat (limited to 'flang/lib/Parser/unparse.cpp')
-rw-r--r-- | flang/lib/Parser/unparse.cpp | 107 |
1 files changed, 47 insertions, 60 deletions
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp index 0a6af74..5882047 100644 --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -2631,90 +2631,77 @@ public: } } void Unparse(const OpenMPDeclareReductionConstruct &x) { + BeginOpenMP(); + Word("!$OMP DECLARE REDUCTION "); Put("("); Walk(std::get<OmpReductionIdentifier>(x.t)), Put(" : "); Walk(std::get<std::list<DeclarationTypeSpec>>(x.t), ","), Put(" : "); Walk(std::get<OmpReductionCombiner>(x.t)); Put(")"); Walk(std::get<std::optional<OmpReductionInitializerClause>>(x.t)); + EndOpenMP(); } - bool Pre(const OpenMPDeclarativeConstruct &x) { + + void Unparse(const OpenMPDeclareMapperConstruct &z) { BeginOpenMP(); - Word("!$OMP "); - return common::visit( - common::visitors{ - [&](const OpenMPDeclarativeAllocate &z) { - Word("ALLOCATE ("); - Walk(std::get<OmpObjectList>(z.t)); - Put(")"); - Walk(std::get<OmpClauseList>(z.t)); - Put("\n"); - EndOpenMP(); - return false; - }, - [&](const OpenMPDeclareMapperConstruct &z) { - Word("DECLARE MAPPER ("); - const auto &spec{std::get<OmpDeclareMapperSpecifier>(z.t)}; - if (auto mapname{std::get<std::optional<Name>>(spec.t)}) { - Walk(mapname); - Put(":"); - } - Walk(std::get<TypeSpec>(spec.t)); - Put("::"); - Walk(std::get<Name>(spec.t)); - Put(")"); + Word("!$OMP DECLARE MAPPER ("); + const auto &spec{std::get<OmpDeclareMapperSpecifier>(z.t)}; + if (auto mapname{std::get<std::optional<Name>>(spec.t)}) { + Walk(mapname); + Put(":"); + } + Walk(std::get<TypeSpec>(spec.t)); + Put("::"); + Walk(std::get<Name>(spec.t)); + Put(")"); - Walk(std::get<OmpClauseList>(z.t)); - Put("\n"); - return false; - }, - [&](const OpenMPDeclareReductionConstruct &) { - Word("DECLARE REDUCTION "); - return true; - }, - [&](const OpenMPDeclareSimdConstruct &y) { - Word("DECLARE SIMD "); - Walk("(", std::get<std::optional<Name>>(y.t), ")"); - Walk(std::get<OmpClauseList>(y.t)); - Put("\n"); - EndOpenMP(); - return false; - }, - [&](const OpenMPDeclareTargetConstruct &) { - Word("DECLARE TARGET "); - return true; - }, - [&](const OpenMPRequiresConstruct &y) { - Word("REQUIRES "); - Walk(std::get<OmpClauseList>(y.t)); - Put("\n"); - EndOpenMP(); - return false; - }, - [&](const OpenMPThreadprivate &) { - Word("THREADPRIVATE ("); - return true; - }, - }, - x.u); + Walk(std::get<OmpClauseList>(z.t)); + Put("\n"); + EndOpenMP(); + } + void Unparse(const OpenMPDeclareSimdConstruct &y) { + BeginOpenMP(); + Word("!$OMP DECLARE SIMD "); + Walk("(", std::get<std::optional<Name>>(y.t), ")"); + Walk(std::get<OmpClauseList>(y.t)); + Put("\n"); + EndOpenMP(); } - void Post(const OpenMPDeclarativeConstruct &) { + void Unparse(const OpenMPDeclareTargetConstruct &x) { + BeginOpenMP(); + Word("!$OMP DECLARE TARGET "); + Walk(std::get<parser::OmpDeclareTargetSpecifier>(x.t)); Put("\n"); EndOpenMP(); } - void Post(const OpenMPThreadprivate &) { + void Unparse(const OpenMPRequiresConstruct &y) { + BeginOpenMP(); + Word("!$OMP REQUIRES "); + Walk(std::get<OmpClauseList>(y.t)); + Put("\n"); + EndOpenMP(); + } + void Unparse(const OpenMPThreadprivate &x) { + BeginOpenMP(); + Word("!$OMP THREADPRIVATE ("); + Walk(std::get<parser::OmpObjectList>(x.t)); Put(")\n"); EndOpenMP(); } + bool Pre(const OmpMessageClause &x) { Walk(x.v); return false; } - void Unparse(const OpenMPErrorConstruct &x) { + void Unparse(const OmpErrorDirective &x) { Word("!$OMP ERROR "); Walk(x.t); Put("\n"); } + void Unparse(const OmpNothingDirective &x) { + Word("!$OMP NOTHING"); + Put("\n"); + } void Unparse(const OmpSectionsDirective &x) { switch (x.v) { case llvm::omp::Directive::OMPD_sections: |