MLIR
18.0.0git
|
This class represents an efficient way to signal success or failure. More...
#include "mlir/Support/LogicalResult.h"
Public Member Functions | |
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... | |
Static Public Member Functions | |
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 an efficient way to signal success or failure.
It should be preferred over the use of bool
when appropriate, as it avoids all of the ambiguity that arises in interpreting a boolean result. This class is marked as NODISCARD to ensure that the result is processed. Users may explicitly discard a result by using (void)
, e.g. (void)functionThatReturnsALogicalResult();
. Given the intended nature of this class, it generally shouldn't be used as the result of functions that very frequently have the result ignored. This class is intended to be used in conjunction with the utility functions below.
Definition at line 26 of file LogicalResult.h.
|
inline |
Returns true if the provided LogicalResult corresponds to a failure value.
Definition at line 44 of file LogicalResult.h.
Referenced by mlir::presburger::SymbolicLexSimplex::computeSymbolicIntegerLexMin(), mlir::failed(), mlir::presburger::LexSimplex::findIntegerLexMin(), mlir::getMultiAffineFunctionFromMap(), mlir::parseDynamicIndexList(), mlir::transform::parsePackedOrDynamicIndexList(), mlir::parseSemiFunctionType(), and parseStructuredTransformDims().
|
inlinestatic |
If isFailure is true a failure
result is generated, otherwise a 'success' result is generated.
Definition at line 36 of file LogicalResult.h.
Referenced by mlir::failure().
|
inline |
Returns true if the provided LogicalResult corresponds to a success value.
Definition at line 41 of file LogicalResult.h.
Referenced by mlir::asMainReturnCode(), mlir::parseDynamicIndexList(), parseForeachMatchSymbols(), mlir::transform::parsePackedOrDynamicIndexList(), mlir::parseSemiFunctionType(), parseStructuredTransformDims(), parseValueWithVariadicity(), and mlir::succeeded().
|
inlinestatic |
If isSuccess is true a success
result is generated, otherwise a 'failure' result is generated.
Definition at line 30 of file LogicalResult.h.
Referenced by mlir::convertVectorToMMAOps(), and mlir::success().