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

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 11:49:32 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");
+  }
+
----------------
joker-eph wrote:

This is in a section about assertions, if you want to include this I don't think it should single out this API but be explicit around line 419.

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


More information about the llvm-commits mailing list