MLIR
18.0.0git
|
This class represents success/failure for parsing-like operations that find it important to chain together failable operations with ||
.
More...
#include "mlir/Support/LogicalResult.h"
Public Member Functions | |
ParseResult (LogicalResult result=success()) | |
operator bool () const | |
Failure is true in a boolean context. More... | |
![]() | |
bool | succeeded () const |
Returns true if the provided LogicalResult corresponds to a success value. More... | |
bool | failed () const |
Returns true if the provided LogicalResult corresponds to a failure value. More... | |
Additional Inherited Members | |
![]() | |
static LogicalResult | success (bool isSuccess=true) |
If isSuccess is true a success result is generated, otherwise a 'failure' result is generated. More... | |
static LogicalResult | failure (bool isFailure=true) |
If isFailure is true a failure result is generated, otherwise a 'success' result is generated. More... | |
This class represents success/failure for parsing-like operations that find it important to chain together failable operations with ||
.
This is an extended version of LogicalResult
that allows for explicit conversion to bool.
This class should not be used for general error handling cases - we prefer to keep the logic explicit with the succeeded
/failed
predicates. However, traditional monadic-style parsing logic can sometimes get swallowed up in boilerplate without this, so we provide this for narrow cases where it is important.
Definition at line 121 of file LogicalResult.h.
|
inline |
Definition at line 123 of file LogicalResult.h.
|
inlineexplicit |
Failure is true in a boolean context.
Definition at line 126 of file LogicalResult.h.
References mlir::failed().