[PATCH] D90210: [flang] [OpenMP 4.5] Add semantic checks for OpenMP Private clause

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 06:24:41 PST 2020


kiranchandramohan requested changes to this revision.
kiranchandramohan added inline comments.
This revision now requires changes to proceed.


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1054
+                  if (privateDataSharingAttributeFlags.test(ompFlag)) {
+                    CheckObjectInNamelist(*name, *symbol, ompFlag);
+                  }
----------------
"Variables that appear in namelist statements, in variable format expressions, and in expressions for statement function definitions, may not appear in a private clause."

The specific restriction that this code checks seems to have two more components. Will the checks for "in variable format expressions, and in expressions for statement function definitions," be in a separate patch?


================
Comment at: flang/lib/Semantics/resolve-directives.cpp:1228
+      context_.Say(name.source,
+          "Variable '%s' in %s clause is used in NAMELIST statement"_err_en_US,
+          name.ToString(), clauseName.str());
----------------
Can this error message be like, Variable in namelist %s cannot be in a ^s clause?


================
Comment at: flang/test/Semantics/omp-private01.f90:21
+
+  !ERROR: Pointer 'q' in the COMMON block with the INTENT(IN) attribute may not appear in a PRIVATE clause
+  !$omp parallel private(/cmn/)
----------------
Is this check required given that dummy arguments can never be part of a common block?


================
Comment at: flang/test/Semantics/omp-private02.f90:1
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
+! OpenMP Version 4.5
----------------
Can we move omp-private03.f90,  omp-private04.f90also into this file?


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

https://reviews.llvm.org/D90210



More information about the llvm-commits mailing list