[flang-commits] [flang] [flang][OpenMP] Diagnose invalid reduction modifiers (PR #92406)

via flang-commits flang-commits at lists.llvm.org
Thu May 16 07:46:35 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff af57ad6536c7df19e6df7217d9d976067fdaf882 2854e272346baad7d5e9a12a8c8243a7c5b210b3 -- flang/lib/Semantics/check-omp-structure.cpp flang/lib/Semantics/check-omp-structure.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 4377f093d0..69e73aeff6 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -2418,8 +2418,8 @@ void OmpStructureChecker::CheckReductionModifier(
     if (dirCtx.directive != llvm::omp::Directive::OMPD_parallel &&
         !llvm::is_contained(worksharing, dirCtx.directive)) {
       context_.Say(GetContext().clauseSource,
-                   "Modifier 'TASK' on REDUCTION clause is only allowed with "
-                   "PARALLEL or worksharing directive"_err_en_US);
+          "Modifier 'TASK' on REDUCTION clause is only allowed with "
+          "PARALLEL or worksharing directive"_err_en_US);
     }
   } else if (modifier == ReductionModifier::Inscan) {
     // Inscan is only allowed on worksharing-loop, worksharing-loop simd,
@@ -2427,19 +2427,20 @@ void OmpStructureChecker::CheckReductionModifier(
     // The worksharing-loop directives are OMPD_do and OMPD_for. Only the
     // former is allowed in Fortran.
     switch (dirCtx.directive) {
-    case llvm::omp::Directive::OMPD_do:      // worksharing-loop
+    case llvm::omp::Directive::OMPD_do: // worksharing-loop
     case llvm::omp::Directive::OMPD_do_simd: // worksharing-loop simd
-    case llvm::omp::Directive::OMPD_simd:    // "simd"
+    case llvm::omp::Directive::OMPD_simd: // "simd"
       break;
     default:
       context_.Say(GetContext().clauseSource,
-                   "Modifier 'INSCAN' on REDUCTION clause is only allowed with "
-                   "worksharing-loop, worksharing-loop simd, "
-                   "or SIMD directive"_err_en_US);
+          "Modifier 'INSCAN' on REDUCTION clause is only allowed with "
+          "worksharing-loop, worksharing-loop simd, "
+          "or SIMD directive"_err_en_US);
     }
   } else {
-    context_.Say(GetContext().clauseSource, "Unexpected modifier on REDUCTION "
-                                            "clause"_err_en_US);
+    context_.Say(GetContext().clauseSource,
+        "Unexpected modifier on REDUCTION "
+        "clause"_err_en_US);
   }
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/92406


More information about the flang-commits mailing list