[flang] [llvm] [flang][OpenMP] Parser support for DEPOBJ plus DEPEND, DESTROY, UPDATE (PR #114074)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 08:46:58 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 d43e4ce77d0a314139655c9cf7c3b533b5b72440 24e8174c47379351577cfd7b7772fee267681bf8 --extensions cpp,h -- flang/include/flang/Parser/dump-parse-tree.h flang/include/flang/Parser/parse-tree.h flang/include/flang/Semantics/symbol.h flang/lib/Lower/OpenMP/ClauseProcessor.cpp flang/lib/Lower/OpenMP/Clauses.cpp flang/lib/Lower/OpenMP/Clauses.h flang/lib/Lower/OpenMP/OpenMP.cpp flang/lib/Parser/openmp-parsers.cpp flang/lib/Parser/parse-tree.cpp flang/lib/Parser/unparse.cpp flang/lib/Semantics/check-omp-structure.cpp flang/lib/Semantics/check-omp-structure.h flang/lib/Semantics/resolve-directives.cpp flang/lib/Semantics/resolve-names.cpp llvm/include/llvm/Frontend/OpenMP/ClauseT.h
``````````

</details>

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

``````````diff
diff --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp
index 4fc910ce4c..45b89de023 100644
--- a/flang/lib/Lower/OpenMP/Clauses.cpp
+++ b/flang/lib/Lower/OpenMP/Clauses.cpp
@@ -341,20 +341,20 @@ ReductionOperator makeReductionOperator(const parser::OmpReductionOperator &inp,
 clause::TaskDependenceType
 makeDepType(const parser::OmpTaskDependenceType &inp) {
   switch (inp.v) {
-    case parser::OmpTaskDependenceType::Type::Depobj:
-      return clause::TaskDependenceType::Depobj;
-    case parser::OmpTaskDependenceType::Type::In:
-      return clause::TaskDependenceType::In;
-    case parser::OmpTaskDependenceType::Type::Inout:
-      return clause::TaskDependenceType::Inout;
-    // Inoutset        // missing-in-parser
-    // Mutexinoutset   // missing-in-parser
-    case parser::OmpTaskDependenceType::Type::Out:
-      return clause::TaskDependenceType::Out;
-    case parser::OmpTaskDependenceType::Type::Sink:
-      return clause::TaskDependenceType::Sink;
-    case parser::OmpTaskDependenceType::Type::Source:
-      return clause::TaskDependenceType::Source;
+  case parser::OmpTaskDependenceType::Type::Depobj:
+    return clause::TaskDependenceType::Depobj;
+  case parser::OmpTaskDependenceType::Type::In:
+    return clause::TaskDependenceType::In;
+  case parser::OmpTaskDependenceType::Type::Inout:
+    return clause::TaskDependenceType::Inout;
+  // Inoutset        // missing-in-parser
+  // Mutexinoutset   // missing-in-parser
+  case parser::OmpTaskDependenceType::Type::Out:
+    return clause::TaskDependenceType::Out;
+  case parser::OmpTaskDependenceType::Type::Sink:
+    return clause::TaskDependenceType::Sink;
+  case parser::OmpTaskDependenceType::Type::Source:
+    return clause::TaskDependenceType::Source;
   }
   llvm_unreachable("Unexpected dependence type");
 }
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index 852898c662..eea4aa5896 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -457,9 +457,9 @@ TYPE_PARSER(
                         parenthesized(Parser<OmpDefaultmapClause>{}))) ||
     "DEPEND" >> construct<OmpClause>(construct<OmpClause::Depend>(
                     parenthesized(Parser<OmpDependClause>{}))) ||
-    "DESTROY" >> construct<OmpClause>(construct<OmpClause::Destroy>(
-                     maybe(parenthesized(construct<OmpDestroyClause>(
-                         Parser<OmpObject>{}))))) ||
+    "DESTROY" >>
+        construct<OmpClause>(construct<OmpClause::Destroy>(maybe(parenthesized(
+            construct<OmpDestroyClause>(Parser<OmpObject>{}))))) ||
     "DEVICE" >> construct<OmpClause>(construct<OmpClause::Device>(
                     parenthesized(Parser<OmpDeviceClause>{}))) ||
     "DEVICE_TYPE" >> construct<OmpClause>(construct<OmpClause::DeviceType>(

``````````

</details>


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


More information about the llvm-commits mailing list