[clang] [flang] [llvm] [flang] Add -fbacktrace and -fno-backtrace (PR #241967)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 08:57:42 PST 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 -- clang/lib/Driver/ToolChains/Flang.cpp flang-rt/include/flang-rt/runtime/environment.h flang-rt/include/flang-rt/runtime/terminator.h flang-rt/lib/runtime/environment.cpp flang-rt/lib/runtime/main.cpp flang-rt/lib/runtime/stop.cpp flang-rt/lib/runtime/terminator.cpp flang/lib/Frontend/CompilerInvocation.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/lib/runtime/stop.cpp b/flang-rt/lib/runtime/stop.cpp
index 8b81ff2e5..5d241860e 100644
--- a/flang-rt/lib/runtime/stop.cpp
+++ b/flang-rt/lib/runtime/stop.cpp
@@ -104,8 +104,7 @@ static void CloseAllExternalUnits(const char *why) {
   }
   if (isErrorStop) {
 #ifdef FLANG_RT_HAVE_CSIGNAL
-    Fortran::runtime::PrintFatalBacktrace(
-        "\nError termination. Backtrace:\n");
+    Fortran::runtime::PrintFatalBacktrace("\nError termination. Backtrace:\n");
 #endif
     Fortran::runtime::ErrorExit(code);
   } else {
@@ -139,8 +138,7 @@ static void CloseAllExternalUnits(const char *why) {
   }
   if (isErrorStop) {
 #ifdef FLANG_RT_HAVE_CSIGNAL
-    Fortran::runtime::PrintFatalBacktrace(
-        "\nError termination. Backtrace:\n");
+    Fortran::runtime::PrintFatalBacktrace("\nError termination. Backtrace:\n");
 #endif
     Fortran::runtime::ErrorExit(EXIT_FAILURE);
   } else {

``````````

</details>


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


More information about the cfe-commits mailing list