[PATCH] D90210: [flang] [OpenMP 4.5] Add semantic checks for OpenMP Private clause
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 29 16:46:04 PDT 2020
kiranchandramohan requested changes to this revision.
kiranchandramohan added a comment.
This revision now requires changes to proceed.
Thanks for this patch. A few comments inline.
================
Comment at: flang/lib/Semantics/check-omp-structure.h:165
-private:
+ void CheckIntentInPointer(
+ const parser::OmpObjectList &, const llvm::omp::Clause);
----------------
Can this be private?
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1087
+ const auto *target{&symbol};
+ if (ompFlagsRequireNewSymbol.test(ompFlag)) {
+ if (const auto *details{symbol.detailsIf<HostAssocDetails>()}) {
----------------
why is this check required?
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1092
+ }
+ auto it{std::find(namelistSymbols.begin(), namelistSymbols.end(), *target)};
+ if (it != namelistSymbols.end()) {
----------------
Can you check what is happening for this testcase here or above and why the error is being missed?
```
program omp_target
integer :: a, b, c
namelist /mylist/ a, b, c
a = 5
b = 10
call sb()
contains
subroutine sb()
!$omp parallel private(a)
c = a+b
!$omp end parallel
write(*, mylist)
end subroutine
end program omp_target
```
================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1094
+ if (it != namelistSymbols.end()) {
+ llvm::StringRef clauseName = "PRIVATE";
+ if (ompFlag == Symbol::Flag::OmpFirstPrivate)
----------------
Nit: Use braced initializer here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90210/new/
https://reviews.llvm.org/D90210
More information about the llvm-commits
mailing list