[clang] [lld] [llvm] [mlir] [LLVM][Windows] Elide `PrettyStackTrace` output for usage errors (PR #140956)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 22 04:17:12 PDT 2025


================
@@ -61,11 +61,14 @@ struct ScopedFatalErrorHandler {
 /// @deprecated Use reportFatalInternalError() or reportFatalUsageError()
 /// instead.
 [[noreturn]] LLVM_ABI void report_fatal_error(const char *reason,
-                                              bool gen_crash_diag = true);
+                                              bool gen_crash_diag = true,
+                                              bool is_usage_error = false);
 [[noreturn]] LLVM_ABI void report_fatal_error(StringRef reason,
-                                              bool gen_crash_diag = true);
+                                              bool gen_crash_diag = true,
+                                              bool is_usage_error = false);
 [[noreturn]] LLVM_ABI void report_fatal_error(const Twine &reason,
-                                              bool gen_crash_diag = true);
+                                              bool gen_crash_diag = true,
+                                              bool is_usage_error = false);
----------------
bd1976bris wrote:

Good questions. 

>If I understood things correctly, the way this is supposed to work is that if GenCrashDiag is true then the following abort() is going to run the signal handlers anyway?

Yes. To keep the previous behaviour where the signal handlers are always run. I need to poke at it a bit. Perhaps the output is OK on Windows without running the signal handlers. I don't understand why the difference exists between the two platforms.

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


More information about the cfe-commits mailing list