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 ( )
default

◆ OptionalParseResult() [2/5]

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

Definition at line 40 of file OpDefinition.h.

◆ OptionalParseResult() [3/5]

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

Definition at line 41 of file OpDefinition.h.

◆ OptionalParseResult() [4/5]

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

Definition at line 42 of file OpDefinition.h.

◆ OptionalParseResult() [5/5]

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

Definition at line 44 of file OpDefinition.h.

Member Function Documentation

◆ getValue()

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

◆ hasValue()

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

◆ operator*()

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

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: