[mlir] Allow Diagnostic/InFlightDiagnostic to convert to FailureOr.
authorbzcheeseman <12992886+bzcheeseman@users.noreply.github.com>
Wed, 30 Mar 2022 08:36:41 +0000 (01:36 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Wed, 30 Mar 2022 08:37:20 +0000 (01:37 -0700)
commit4fec44b0e63d0dcde0897cf55670ccc1748c8654
treec0c8b59e3f3a08ce6f770d22dff1909c00df2a53
parenta60e09509c8cee9bf11e6f4d84271bf755884a0e
[mlir] Allow Diagnostic/InFlightDiagnostic to convert to FailureOr.

Allow conversion of a diagnostic to FailureOr. This conversion only results
in `failure` because in the case where operator LogicalResult would return
success, the FailureOr constructor would assert.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D122596
mlir/include/mlir/IR/Diagnostics.h