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

Valentin Clement via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Oct 22 08:30:06 PDT 2020


clementval added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.h:155
   void Enter(const parser::OmpClause::IsDevicePtr &);
+  // Memory-order-clause
+  void Enter(const parser::OmpClause::SeqCst &);
----------------
sameeranjoshi wrote:
> kiranchandramohan wrote:
> > Thinking about this again. It will be good if we can retain memory-order-clause in the parse tree. Since the standard specifically talks about memory-order-clauses. If we write a frontend tool to list all memory order clauses then if there is a representation for memory-order-clause in the parse tree it will be easy to process all memory-order-clauses.
> The whole discussion to change parser started when failing to implement semantic checks(given that we had code) without changing parser.
> 
> Reason being that `memory-order-clauses` were not part of `OmpClause` inside `openmp-parsers.cpp`.
> 
> I am happy to change it If that's possible.
> Also if @clementval shares some opinions on this issue, he might have a better overview.
Well, I don't have a strong opinion on that but if you want to use the directive-clauses map generated by TableGen you need to have clauses in OmpClause. 

I think there could be a way to keep the clauses in OmpClause and have a separate parser that handle the `memory-order-clauses` and that could be applied to Atomic for example. 


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

https://reviews.llvm.org/D89583



More information about the flang-commits mailing list