[PATCH] D92732: [Flang][OpenMP 4.5] Add semantic check for OpenMP Do Loop Constructs
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 14 09:18:13 PST 2021
kiranchandramohan accepted this revision.
kiranchandramohan added a comment.
This revision is now accepted and ready to land.
LGTM. I have a Nit comment.
Did you create a separate PR for the threadprivate checks?
================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:246-248
+ const auto it{block.begin()};
+ loop = it != block.end() ? parser::Unwrap<parser::DoConstruct>(*it)
+ : nullptr;
----------------
yhegde wrote:
> kiranchandramohan wrote:
> > Is something missing here?
> > If "it" is block.begin() in the previous patch, how can it ever be block.end in this line unless the block is empty?
> >
> > If nothing is missing, add a comment.
> > Is something missing here?
> > If "it" is block.begin() in the previous patch, how can it ever be block.end in this line unless the block is empty?
> >
> I think If the block is empty then Fortran::parser::ExecutableConstruct has "no contained value". If block is not empty then DoConstruct, if exists in ExecutableConstruct, is fetched. Please let me know otherwise.
>
> > If nothing is missing, add a comment.
>
>
Nit: Consider switching to the following.
```
loop = block.empty() ? nullptr : parser::Unwrap<parser::DoConstruct>(block.begin());
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92732/new/
https://reviews.llvm.org/D92732
More information about the llvm-commits
mailing list