MLIR  15.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 (llvm::NoneType)
bool hasValue () const
 Returns true if we contain a valid ParseResult value. More...
ParseResult getValue () 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 37 of file OpDefinition.h.

Constructor & Destructor Documentation

◆ OptionalParseResult() [1/5]

mlir::OptionalParseResult::OptionalParseResult ( )

◆ OptionalParseResult() [2/5]

mlir::OptionalParseResult::OptionalParseResult ( LogicalResult  result)

Definition at line 40 of file OpDefinition.h.

◆ OptionalParseResult() [3/5]

mlir::OptionalParseResult::OptionalParseResult ( ParseResult  result)

Definition at line 41 of file OpDefinition.h.

◆ OptionalParseResult() [4/5]

mlir::OptionalParseResult::OptionalParseResult ( const InFlightDiagnostic )

Definition at line 42 of file OpDefinition.h.

◆ OptionalParseResult() [5/5]

mlir::OptionalParseResult::OptionalParseResult ( llvm::NoneType  )

Definition at line 44 of file OpDefinition.h.

Member Function Documentation

◆ getValue()

ParseResult mlir::OptionalParseResult::getValue ( ) const

◆ hasValue()

bool mlir::OptionalParseResult::hasValue ( ) const

◆ operator*()

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

Definition at line 51 of file OpDefinition.h.

References mlir::impl::ensureRegionTerminator(), and getValue().

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