diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
commit | fea7da1b00cc97d742faede2df96c7d327950f49 (patch) | |
tree | 4de1d6b4ddc69f4f32daabb11ad5c71ab0cf895e /flang/lib/Parser/unparse.cpp | |
parent | 9b99dde0d47102625d93c5d1cbbc04951025a6c9 (diff) | |
parent | 0aa930a41f2d1ebf1fa90ec42da8f96d15a4dcbb (diff) | |
download | llvm-users/chapuni/cov/single/nextcount.zip llvm-users/chapuni/cov/single/nextcount.tar.gz llvm-users/chapuni/cov/single/nextcount.tar.bz2 |
Merge branch 'users/chapuni/cov/single/nextcount-base' into users/chapuni/cov/single/nextcountusers/chapuni/cov/single/nextcount
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: |