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

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 12:12:04 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:

Ack, good point about the surrounding context. I think more detail on exactly what `reportFatalInternalError` does would be helpful, but I agree the section in general could be made more explicit. Probably makes more sense as a separate PR then.

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


More information about the llvm-commits mailing list