diff options
author | Peter Klausler <pklausler@nvidia.com> | 2023-04-10 11:05:03 -0700 |
---|---|---|
committer | Peter Klausler <pklausler@nvidia.com> | 2023-04-19 09:39:37 -0700 |
commit | 864cb2aa451480b6d1907fd7bc4262c72b537a7c (patch) | |
tree | eefa308881edb4e6df4dfab3534c75ea1504ccc7 /flang/lib/Semantics/mod-file.cpp | |
parent | 029bfc311d4d7d3cd90be81bb08c046848796d02 (diff) | |
download | llvm-864cb2aa451480b6d1907fd7bc4262c72b537a7c.zip llvm-864cb2aa451480b6d1907fd7bc4262c72b537a7c.tar.gz llvm-864cb2aa451480b6d1907fd7bc4262c72b537a7c.tar.bz2 |
[flang] Semantics for !DIR$ IGNORE_TKR
Implement semantics for the IGNORE_TKR directive as it is interpreted
by the PGI / NVFORTRAN compiler.
Differential Revision: https://reviews.llvm.org/D148643
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r-- | flang/lib/Semantics/mod-file.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp index 77ba428..8ff4469 100644 --- a/flang/lib/Semantics/mod-file.cpp +++ b/flang/lib/Semantics/mod-file.cpp @@ -480,7 +480,6 @@ void ModFileWriter::PutSubprogram(const Symbol &symbol) { } } os << '\n'; - // walk symbols, collect ones needed for interface const Scope &scope{ details.entryScope() ? *details.entryScope() : DEREF(symbol.scope())}; @@ -684,6 +683,33 @@ void ModFileWriter::PutObjectEntity( PutShape(os, details.coshape(), '[', ']'); PutInit(os, symbol, details.init(), details.unanalyzedPDTComponentInit()); os << '\n'; + if (auto tkr{GetIgnoreTKR(symbol)}; !tkr.empty()) { + os << "!dir$ ignore_tkr("; + tkr.IterateOverMembers([&](common::IgnoreTKR tkr) { + switch (tkr) { + SWITCH_COVERS_ALL_CASES + case common::IgnoreTKR::Type: + os << 't'; + break; + case common::IgnoreTKR::Kind: + os << 'k'; + break; + case common::IgnoreTKR::Rank: + os << 'r'; + break; + case common::IgnoreTKR::Device: + os << 'd'; + break; + case common::IgnoreTKR::Managed: + os << 'm'; + break; + case common::IgnoreTKR::Contiguous: + os << 'c'; + break; + } + }); + os << ") " << symbol.name() << '\n'; + } } void ModFileWriter::PutProcEntity(llvm::raw_ostream &os, const Symbol &symbol) { |