diff options
author | Valentin Clement <clementval@gmail.com> | 2023-08-07 09:52:44 -0700 |
---|---|---|
committer | Valentin Clement <clementval@gmail.com> | 2023-08-07 09:53:09 -0700 |
commit | a749b32a11055aa680db7cdcb68687345132abe5 (patch) | |
tree | 837898aee96a93462ae87f1340dc3413d8c4c196 /flang/lib/Semantics/mod-file.cpp | |
parent | 6c45b0f603ec23295e9774ccb4ef2c0ce9b75422 (diff) | |
download | llvm-a749b32a11055aa680db7cdcb68687345132abe5.zip llvm-a749b32a11055aa680db7cdcb68687345132abe5.tar.gz llvm-a749b32a11055aa680db7cdcb68687345132abe5.tar.bz2 |
[flang][openacc] Support readonly modifier for declare copyin in module file
Distinguish between copyin and copyin with the readonly modifier.
Depends on D157121
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D157125
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r-- | flang/lib/Semantics/mod-file.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp index 4822673..c88e209 100644 --- a/flang/lib/Semantics/mod-file.cpp +++ b/flang/lib/Semantics/mod-file.cpp @@ -877,7 +877,8 @@ void PutOpenACCDirective(llvm::raw_ostream &os, const Symbol &symbol) { os << "!$acc declare "; if (symbol.test(Symbol::Flag::AccCopy)) { os << "copy"; - } else if (symbol.test(Symbol::Flag::AccCopyIn)) { + } else if (symbol.test(Symbol::Flag::AccCopyIn) || + symbol.test(Symbol::Flag::AccCopyInReadOnly)) { os << "copyin"; } else if (symbol.test(Symbol::Flag::AccCopyOut)) { os << "copyout"; @@ -892,7 +893,11 @@ void PutOpenACCDirective(llvm::raw_ostream &os, const Symbol &symbol) { } else if (symbol.test(Symbol::Flag::AccLink)) { os << "link"; } - os << "(" << symbol.name() << ")\n"; + os << "("; + if (symbol.test(Symbol::Flag::AccCopyInReadOnly)) { + os << "readonly: "; + } + os << symbol.name() << ")\n"; } } |