[PATCH] D90697: [Flang][OpenMP 4.5] Add semantic check for OpenMP Reduction Clause

Yashaswini Hegde via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 10:09:44 PST 2021


yhegde marked 3 inline comments as done.
yhegde added a comment.





================
Comment at: flang/lib/Semantics/check-directive-structure.h:208
 
+  DirectiveContext *GetEnclosingDirContext() {
+    CHECK(!dirContext_.empty());
----------------
kiranchandramohan wrote:
> Nit: Praveen added a "GetEnclosingContextWithDir" with D91920.
They are two different functions. GetEnclosingDirContext() checks the immediate enclosing directive context. 


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:521
 
+void OmpStructureChecker::Leave(const parser::OmpEndBlockDirective &x) {
+  if ((GetContext().directive == llvm::omp::Directive::OMPD_end_single) ||
----------------
kiranchandramohan wrote:
> Nit: Please add a comment on why this pop is required and why it is only for these two directives. If more are to be added later on then please add a todo.
There are many begin and end directive mismatch checks in omp-clause-validity01.f90. Hence  popping  the right directive context was required. 


================
Comment at: flang/test/Semantics/omp-reduction07.f90:4
+! 2.15.3.6 Reduction Clause
+program omp_reduction
+
----------------
kiranchandramohan wrote:
> Nit: convert one of the tests in this file to work with max/min/....
omp-reduction07.f90 updated with max/min etc


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90697



More information about the llvm-commits mailing list