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

sameeran joshi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 08:44:34 PST 2020


sameeranjoshi added inline comments.


================
Comment at: flang/include/flang/Parser/parse-tree.h:3634
+};
+// 2.17.7 atomic ->
+//        ATOMIC [atomic-clause-list] atomic-construct [atomic-clause-list] |
----------------
clementval wrote:
> Is the comment at the right place? 
No, thx.


================
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,
----------------
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`.


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