File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,15 @@ that should never be entered if the program invariants hold:
437
437
llvm_unreachable("X should be Foo or Bar here");
438
438
}
439
439
440
+ Additionally, ``reportFatalInternalError `` can be used to report invariant
441
+ violations even in builds that do not enable assertions:
442
+
443
+ .. code-block :: c++
444
+
445
+ if (VerifyFooAnalysis && !Foo.verify()) {
446
+ reportFatalInternalError("Analysis 'foo' not preserved");
447
+ }
448
+
440
449
Recoverable Errors
441
450
^^^^^^^^^^^^^^^^^^
442
451
@@ -452,9 +461,9 @@ recovery.
452
461
While it would be ideal to use this error handling scheme throughout
453
462
LLVM, there are places where this hasn't been practical to apply. In
454
463
situations where you absolutely must emit a non-programmatic error and
455
- the ``Error `` model isn't workable you can call ``report_fatal_error ``,
456
- which will call installed error handlers, print a message, and abort the
457
- program. The use of `report_fatal_error ` in this case is discouraged.
464
+ the ``Error `` model isn't workable you can call ``reportFatalUsageError ``,
465
+ which will call installed error handlers, print a message, and exit the
466
+ program. The use of `reportFatalUsageError ` in this case is discouraged.
458
467
459
468
Recoverable errors are modeled using LLVM's ``Error `` scheme. This scheme
460
469
represents errors using function return values, similar to classic C integer
You can’t perform that action at this time.
0 commit comments