[llvm] [ProgrammersManual] Update report_fatal_error docs (PR #138502)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 11:46:34 PDT 2025


================
@@ -437,6 +437,15 @@ that should never be entered if the program invariants hold:
       llvm_unreachable("X should be Foo or Bar here");
   }
 
+Additionally, ``reportFatalInternalError`` can be used to report invariant
+violations even in builds that do not enable assertions:
+
+.. code-block:: c++
+
+  if (VerifyFooAnalysis && !Foo.verify()) {
+    reportFatalInternalError("Analysis 'foo' not preserved");
+  }
+
----------------
asb wrote:

I think it would be helpful to additionally say "This will produce a crash trace and will ask users to report an LLVM bug." as you do in the doc comment in the header. But this is a non-blocking suggestion.

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


More information about the llvm-commits mailing list