MLIR  14.0.0git
Public Member Functions | List of all members
mlir::ParseResult Class Reference

This class represents success/failure for operation parsing. More...

#include "mlir/IR/OpDefinition.h"

Inheritance diagram for mlir::ParseResult:
Inheritance graph
[legend]
Collaboration diagram for mlir::ParseResult:
Collaboration graph
[legend]

Public Member Functions

 ParseResult (LogicalResult result=success())
 
 ParseResult (const InFlightDiagnostic &)
 
 ParseResult (const Diagnostic &)
 
 operator bool () const
 Failure is true in a boolean context. More...
 
- Public Member Functions inherited from mlir::LogicalResult
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 Public Member Functions inherited from mlir::LogicalResult
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...
 

Detailed Description

This class represents success/failure for operation parsing.

It is essentially a simple wrapper class around LogicalResult that allows for explicit conversion to bool. This allows for the parser to chain together parse rules without the clutter of "failed/succeeded".

Definition at line 36 of file OpDefinition.h.

Constructor & Destructor Documentation

◆ ParseResult() [1/3]

mlir::ParseResult::ParseResult ( LogicalResult  result = success())
inline

Definition at line 38 of file OpDefinition.h.

◆ ParseResult() [2/3]

mlir::ParseResult::ParseResult ( const InFlightDiagnostic )
inline

Definition at line 41 of file OpDefinition.h.

◆ ParseResult() [3/3]

mlir::ParseResult::ParseResult ( const Diagnostic )
inline

Definition at line 42 of file OpDefinition.h.

Member Function Documentation

◆ operator bool()

mlir::ParseResult::operator bool ( ) const
inlineexplicit

Failure is true in a boolean context.

Definition at line 45 of file OpDefinition.h.

References mlir::LogicalResult::failed().


The documentation for this class was generated from the following file: