[PATCH] D89583: [Flang][OpenMP] Semantic checks for Atomic construct.

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 12:50:30 PST 2020


clementval accepted this revision.
clementval added a comment.
This revision is now accepted and ready to land.

Looks ok to me. Just a small comment on the `OmpAtomic` leave



================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:487
+void OmpStructureChecker::Leave(const parser::OmpAtomic &) {
+  if (const auto *clause{FindClause(llvm::omp::Clause::OMPC_acquire)}) {
+    context_.Say(clause->source,
----------------
sameeranjoshi wrote:
> clementval wrote:
> > Where do you check that it is only for update? 
> I check separately for both
> `If atomic-clause is update or not present then memory-order-clause must not be acq_rel or acquire.`
> break into below
> restriction:
> ```If atomic-clause is update then memory-order-clause must not be acq_rel or acquire.```
> in
> `void OmpStructureChecker::Leave(const parser::OmpAtomicUpdate &)`
> &
> ```If atomic-clause is not present then memory-order-clause must not be acq_rel or acquire.```
> in this `Leave`.
Ok I see. The `OmpAtomic` is the atomic construct without clause? If so, maybe adding small comment here to precise this would be nice. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89583/new/

https://reviews.llvm.org/D89583



More information about the llvm-commits mailing list