[flang-commits] [flang] [llvm] [flang][llvm][OpenMP][OpenACC] Add implicit casts to omp.atomic and acc.atomic (PR #131603)

via flang-commits flang-commits at lists.llvm.org
Tue Apr 15 07:38:29 PDT 2025


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 HEAD~1 HEAD --extensions h,cpp -- flang/include/flang/Lower/DirectivesCommon.h llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/include/flang/Lower/DirectivesCommon.h b/flang/include/flang/Lower/DirectivesCommon.h
index 41502b212..3eeca74e4 100644
--- a/flang/include/flang/Lower/DirectivesCommon.h
+++ b/flang/include/flang/Lower/DirectivesCommon.h
@@ -368,14 +368,17 @@ void genOmpAccAtomicRead(Fortran::lower::AbstractConverter &converter,
     rightHandClauseList = &std::get<2>(atomicRead.t);
     leftHandClauseList = &std::get<0>(atomicRead.t);
   }
- 
+
   const Fortran::parser::AssignmentStmt &stmt =
-	  std::get<Fortran::parser::Statement<Fortran::parser::AssignmentStmt>>(
-			  atomicRead.t).statement;
+      std::get<Fortran::parser::Statement<Fortran::parser::AssignmentStmt>>(
+          atomicRead.t)
+          .statement;
   const Fortran::evaluate::Assignment &assign = *stmt.typedAssignment->v;
   Fortran::lower::StatementContext stmtCtx;
-  mlir::Value fromAddress = fir::getBase(converter.genExprAddr(assign.rhs, stmtCtx));
-  mlir::Value toAddress = fir::getBase(converter.genExprAddr(assign.lhs, stmtCtx));
+  mlir::Value fromAddress =
+      fir::getBase(converter.genExprAddr(assign.rhs, stmtCtx));
+  mlir::Value toAddress =
+      fir::getBase(converter.genExprAddr(assign.lhs, stmtCtx));
   mlir::Type elementType = fir::unwrapRefType(fromAddress.getType());
   genOmpAccAtomicCaptureStatement(converter, fromAddress, toAddress,
                                   leftHandClauseList, rightHandClauseList,
@@ -473,8 +476,8 @@ void genOmpAccAtomicCapture(Fortran::lower::AbstractConverter &converter,
       fir::getBase(converter.genExprValue(assign2.lhs, stmtCtx)).getType();
 
   // Check if implicit type is needed
-  if(stmt1VarType != stmt2VarType)
-	  TODO(loc, "atomic capture requiring implicit type casts");
+  if (stmt1VarType != stmt2VarType)
+    TODO(loc, "atomic capture requiring implicit type casts");
   mlir::Operation *atomicCaptureOp = nullptr;
   if constexpr (std::is_same<AtomicListT,
                              Fortran::parser::OmpAtomicClauseList>()) {

``````````

</details>


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


More information about the flang-commits mailing list