[Mlir-commits] [flang] [llvm] [mlir] [Flang] [Runtime ]Fix write endfile abort (PR #191633)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Apr 11 07:40:33 PDT 2026


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 origin/main HEAD --extensions h,cpp -- flang-rt/include/flang-rt/runtime/io-error.h flang-rt/lib/runtime/unit.cpp mlir/lib/IR/BuiltinDialectBytecode.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/flang-rt/include/flang-rt/runtime/io-error.h b/flang-rt/include/flang-rt/runtime/io-error.h
index 4691a0ff5..088fc76a7 100644
--- a/flang-rt/include/flang-rt/runtime/io-error.h
+++ b/flang-rt/include/flang-rt/runtime/io-error.h
@@ -35,9 +35,9 @@ public:
   RT_API_ATTRS void HasIoMsg() { flags_ |= hasIoMsg; }
   RT_API_ATTRS void HasRec() { flags_ |= hasRec; }
   RT_API_ATTRS void SignalPendingIoStat(int iostat) {
-  if (ioStat_ == IostatOk || ioStat_ == IostatEnd || ioStat_ == IostatEor)
-    ioStat_ = iostat;
-}
+    if (ioStat_ == IostatOk || ioStat_ == IostatEnd || ioStat_ == IostatEor)
+      ioStat_ = iostat;
+  }
 
   RT_API_ATTRS bool InError() const {
     return ioStat_ != IostatOk || pendingError_ != IostatOk;
diff --git a/flang-rt/lib/runtime/unit.cpp b/flang-rt/lib/runtime/unit.cpp
index 32a48cd4f..5dfc17022 100644
--- a/flang-rt/lib/runtime/unit.cpp
+++ b/flang-rt/lib/runtime/unit.cpp
@@ -84,7 +84,7 @@ bool ExternalFileUnit::Emit(const char *data, std::size_t bytes,
     beganReadingRecord_ = false;
   }
   if (IsAfterEndfile()) {
-     handler.SignalPendingIoStat(IostatWriteAfterEndfile);
+    handler.SignalPendingIoStat(IostatWriteAfterEndfile);
     return false;
   }
   CheckDirectAccess(handler);

``````````

</details>


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


More information about the Mlir-commits mailing list