[PATCH] D89546: [Flang][OpenMP 4.5] Add semantic check for OpenMP schedule clause

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 14:30:16 PST 2020


kiranchandramohan accepted this revision.
kiranchandramohan added a comment.
This revision is now accepted and ready to land.

LGTM. Have a nit comment inline about how to construct the message.



================
Comment at: flang/lib/Semantics/check-directive-structure.h:376-387
+    const parser::ScalarIntExpr &i, parser::MessageFixedText msg) {
   if (const auto v{GetIntValue(i)}) {
     if (*v <= 0) {
-      context_.Say(GetContext().clauseSource,
-          "The parameter of the %s clause must be "
-          "a positive integer expression"_err_en_US,
-          parser::ToUpperCaseLetters(getClauseName(clause).str()));
+      if (msg.text().empty()) {
+        context_.Say(GetContext().clauseSource,
+            "The parameter of the %s clause must be "
+            "a positive integer expression"_err_en_US,
----------------
Nits:
1) Can msg be a String/StringRef with name paramName?
2) Can paramName be non-optional? Set it to "" at other places.
3) The error message can possibly be constructed like.
"The %s of the %s clause must be "
"a positive integer expression"_err_en_US,
paramName.str(),
parser::ToUpperCaseLetters(getClauseName(clause).str()))


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89546



More information about the llvm-commits mailing list