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

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Oct 21 11:36:57 PDT 2020


sameeranjoshi marked an inline comment as done.
sameeranjoshi added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:10
 #include "check-omp-structure.h"
+#include "flang/Common/Fortran.h"
 #include "flang/Parser/parse-tree.h"
----------------
clementval wrote:
> Is this necessary? 
For `common::visitors` I will see of they can be removed.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:515
+    context_.Say(clause->source,
+        "Clause ACQUIRE is not allowed on the ATOMIC directive"_err_en_US);
+  }
----------------
clementval wrote:
> Why is there a specific check for this? If it is not allowed it should not be in `OMP.td` and then catch be `CheckAllowed` in enter acquire. 
Standard says:
`If atomic-clause is update or not present then memory-order-clause must not be acq_rel or acquire.`

I couldn't use `CheckNotAllowedIfClause` here reason being there is no `OMPC_atomic`.
I see `OMPC_atomic_default_mem_order` but I doubt it's the same what I was trying to find.

also `aquire` `acq_rel` are not allowed only here they might be allowed somewhere else, hence changing them in `OMP.td` would affect other atomic directives as well.


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

https://reviews.llvm.org/D89583



More information about the flang-commits mailing list