MLIR  20.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 ( )
default

◆ OptionalParseResult() [2/5]

mlir::OptionalParseResult::OptionalParseResult ( LogicalResult  result)
inline

Definition at line 42 of file OpDefinition.h.

◆ OptionalParseResult() [3/5]

mlir::OptionalParseResult::OptionalParseResult ( ParseResult  result)
inline

Definition at line 43 of file OpDefinition.h.

◆ OptionalParseResult() [4/5]

mlir::OptionalParseResult::OptionalParseResult ( const InFlightDiagnostic )
inline

Definition at line 44 of file OpDefinition.h.

◆ OptionalParseResult() [5/5]

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

Definition at line 46 of file OpDefinition.h.

Member Function Documentation

◆ has_value()

bool mlir::OptionalParseResult::has_value ( ) const
inline

◆ operator*()

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

Definition at line 53 of file OpDefinition.h.

References value().

◆ value()

ParseResult mlir::OptionalParseResult::value ( ) const
inline

Access the internal ParseResult value.

Definition at line 52 of file OpDefinition.h.

Referenced by operator*(), mlir::OpAsmParser::parseAssignmentList(), parseGEPIndices(), parseKeyValuePair(), and parseSequenceOpOperands().


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