MLIR  19.0.0git
Public Member Functions | List of all members
mlir::OptionalParseResult Class Reference

This class implements Optional functionality for ParseResult. More...

#include "mlir/IR/OpDefinition.h"

Public Member Functions

 OptionalParseResult ()=default
 OptionalParseResult (LogicalResult result)
 OptionalParseResult (ParseResult result)
 OptionalParseResult (const InFlightDiagnostic &)
 OptionalParseResult (std::nullopt_t)
bool has_value () const
 Returns true if we contain a valid ParseResult value. More...
ParseResult value () const
 Access the internal ParseResult value. More...
ParseResult operator* () const

Detailed Description

This class implements Optional functionality for ParseResult.

We don't directly use Optional here, because it provides an implicit conversion to 'bool' which we want to avoid. This class is used to implement tri-state 'parseOptional' functions that may have a failure mode when parsing that shouldn't be attributed to "not present".

Definition at line 39 of file OpDefinition.h.

Constructor & Destructor Documentation

◆ OptionalParseResult() [1/5]

mlir::OptionalParseResult::OptionalParseResult ( )

◆ OptionalParseResult() [2/5]

mlir::OptionalParseResult::OptionalParseResult ( LogicalResult  result)

Definition at line 42 of file OpDefinition.h.

◆ OptionalParseResult() [3/5]

mlir::OptionalParseResult::OptionalParseResult ( ParseResult  result)

Definition at line 43 of file OpDefinition.h.

◆ OptionalParseResult() [4/5]

mlir::OptionalParseResult::OptionalParseResult ( const InFlightDiagnostic )

Definition at line 44 of file OpDefinition.h.

◆ OptionalParseResult() [5/5]

mlir::OptionalParseResult::OptionalParseResult ( std::nullopt_t  )

Definition at line 46 of file OpDefinition.h.

Member Function Documentation

◆ has_value()

bool mlir::OptionalParseResult::has_value ( ) const

◆ operator*()

ParseResult mlir::OptionalParseResult::operator* ( ) const

Definition at line 53 of file OpDefinition.h.

References value().

◆ value()

ParseResult mlir::OptionalParseResult::value ( ) const

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