[flang] [llvm] [flang][OpenMP] Add parsing support for Task detach (PR #112312)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 22:52:33 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 3733b0cff314e1427b1a905e6e7438b536f9a96d 2a51b4d0291f4e722f6730449796aec0e5f76fa3 --extensions cpp,h -- flang/include/flang/Parser/dump-parse-tree.h flang/include/flang/Parser/parse-tree.h flang/lib/Parser/openmp-parsers.cpp flang/lib/Parser/unparse.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index 2a67f87128..041459857d 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -299,8 +299,7 @@ TYPE_CONTEXT_PARSER("Omp LINEAR clause"_en_US,
             nonemptyList(name), maybe(":" >> scalarIntConstantExpr)))))
 
 // 12.5.2 detach-clause -> DETACH (event-handle)
-TYPE_PARSER(construct<OmpDetachClause>(
-	Parser<OmpObject>{}))
+TYPE_PARSER(construct<OmpDetachClause>(Parser<OmpObject>{}))
 
 // 2.8.1 ALIGNED (list: alignment)
 TYPE_PARSER(construct<OmpAlignedClause>(
@@ -419,7 +418,7 @@ TYPE_PARSER(
     "IN_REDUCTION" >> construct<OmpClause>(construct<OmpClause::InReduction>(
                           parenthesized(Parser<OmpInReductionClause>{}))) ||
     "DETACH" >> construct<OmpClause>(construct<OmpClause::Detach>(
-		    	  parenthesized(Parser<OmpDetachClause>{}))) ||
+                    parenthesized(Parser<OmpDetachClause>{}))) ||
     "TASK_REDUCTION" >>
         construct<OmpClause>(construct<OmpClause::TaskReduction>(
             parenthesized(Parser<OmpReductionClause>{}))) ||
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index bb8ec168ce..3ac8743023 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -2131,9 +2131,7 @@ public:
     Put(":");
     Walk(std::get<OmpObjectList>(x.t));
   }
-  void Unparse(const OmpDetachClause &x){
-    Walk(x.v);
-  }
+  void Unparse(const OmpDetachClause &x) { Walk(x.v); }
   void Unparse(const OmpInReductionClause &x) {
     Walk(std::get<OmpReductionOperator>(x.t));
     Put(":");

``````````

</details>


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


More information about the llvm-commits mailing list