forked from OSchip/llvm-project
[Support] Fix comments for handleAllErrors: it calls llvm_unreachable if the
contract is violated, not report_fatal_error. llvm-svn: 326413
This commit is contained in:
parent
06292869cd
commit
10dc93c232
|
@ -882,16 +882,16 @@ Error handleErrors(Error E, HandlerTs &&... Hs) {
|
|||
return handleErrorImpl(std::move(Payload), std::forward<HandlerTs>(Hs)...);
|
||||
}
|
||||
|
||||
/// Behaves the same as handleErrors, except that it requires that all
|
||||
/// errors be handled by the given handlers. If any unhandled error remains
|
||||
/// after the handlers have run, report_fatal_error() will be called.
|
||||
/// Behaves the same as handleErrors, except that by contract all errors
|
||||
/// *must* be handled by the given handlers (i.e. there must be no remaining
|
||||
/// errors after running the handlers, or llvm_unreachable is called).
|
||||
template <typename... HandlerTs>
|
||||
void handleAllErrors(Error E, HandlerTs &&... Handlers) {
|
||||
cantFail(handleErrors(std::move(E), std::forward<HandlerTs>(Handlers)...));
|
||||
}
|
||||
|
||||
/// Check that E is a non-error, then drop it.
|
||||
/// If E is an error report_fatal_error will be called.
|
||||
/// If E is an error, llvm_unreachable will be called.
|
||||
inline void handleAllErrors(Error E) {
|
||||
cantFail(std::move(E));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue