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

The result of a transform IR operation application. More...

#include "mlir/Dialect/Transform/Utils/DiagnosedSilenceableFailure.h"

Public Member Functions

 DiagnosedSilenceableFailure (const DiagnosedSilenceableFailure &)=delete
 
DiagnosedSilenceableFailureoperator= (const DiagnosedSilenceableFailure &)=delete
 
 DiagnosedSilenceableFailure (DiagnosedSilenceableFailure &&)=default
 
DiagnosedSilenceableFailureoperator= (DiagnosedSilenceableFailure &&)=default
 
LogicalResult checkAndReport ()
 Converts all kinds of failure into a LogicalResult failure, emitting the diagnostic if necessary. More...
 
bool succeeded () const
 Returns true if this is a success. More...
 
bool isDefiniteFailure () const
 Returns true if this is a definite failure. More...
 
bool isSilenceableFailure () const
 Returns true if this is a silenceable failure. More...
 
std::string getMessage () const
 Returns the diagnostic message without emitting it. More...
 
std::string getStatusString () const
 Returns a string representation of the failure mode (for error reporting). More...
 
LogicalResult silence ()
 Converts silenceable failure into LogicalResult success without reporting the diagnostic, preserves the other states. More...
 
void takeDiagnostics (SmallVectorImpl< Diagnostic > &diags)
 Take the diagnostics and silence. More...
 
template<typename T >
DiagnosedSilenceableFailureoperator<< (T &&value) &
 Streams the given values into the last diagnostic. More...
 
template<typename T >
DiagnosedSilenceableFailure && operator<< (T &&value) &&
 
DiagnosticattachNote (std::optional< Location > loc=std::nullopt)
 Attaches a note to the last diagnostic. More...
 

Static Public Member Functions

static DiagnosedSilenceableFailure success ()
 Constructs a DiagnosedSilenceableFailure in the success state. More...
 
static DiagnosedSilenceableFailure definiteFailure ()
 Constructs a DiagnosedSilenceableFailure in the failure state. More...
 
static DiagnosedSilenceableFailure silenceableFailure (Diagnostic &&diag)
 Constructs a DiagnosedSilenceableFailure in the silenceable failure state, ready to emit the given diagnostic. More...
 
static DiagnosedSilenceableFailure silenceableFailure (SmallVector< Diagnostic > &&diag)
 

Detailed Description

The result of a transform IR operation application.

This can have one of the three states:

Definition at line 38 of file DiagnosedSilenceableFailure.h.

Constructor & Destructor Documentation

◆ DiagnosedSilenceableFailure() [1/2]

mlir::DiagnosedSilenceableFailure::DiagnosedSilenceableFailure ( const DiagnosedSilenceableFailure )
delete

◆ DiagnosedSilenceableFailure() [2/2]

mlir::DiagnosedSilenceableFailure::DiagnosedSilenceableFailure ( DiagnosedSilenceableFailure &&  )
default

Member Function Documentation

◆ attachNote()

Diagnostic& mlir::DiagnosedSilenceableFailure::attachNote ( std::optional< Location loc = std::nullopt)
inline

Attaches a note to the last diagnostic.

Expects this object to be a silenceable failure.

Definition at line 140 of file DiagnosedSilenceableFailure.h.

◆ checkAndReport()

LogicalResult mlir::DiagnosedSilenceableFailure::checkAndReport ( )

Converts all kinds of failure into a LogicalResult failure, emitting the diagnostic if necessary.

Must not be called more than once.

Definition at line 19 of file DiagnosedSilenceableFailure.cpp.

References mlir::failure().

◆ definiteFailure()

static DiagnosedSilenceableFailure mlir::DiagnosedSilenceableFailure::definiteFailure ( )
inlinestatic

Constructs a DiagnosedSilenceableFailure in the failure state.

Typically, a diagnostic has been emitted before this.

Definition at line 54 of file DiagnosedSilenceableFailure.h.

References mlir::failure().

Referenced by mlir::transform::TransformState::applyTransform(), and mlir::DiagnosedDefiniteFailure::operator DiagnosedSilenceableFailure().

◆ getMessage()

std::string mlir::DiagnosedSilenceableFailure::getMessage ( ) const
inline

Returns the diagnostic message without emitting it.

Expects this object to be a silenceable failure.

Definition at line 89 of file DiagnosedSilenceableFailure.h.

◆ getStatusString()

std::string mlir::DiagnosedSilenceableFailure::getStatusString ( ) const
inline

Returns a string representation of the failure mode (for error reporting).

Definition at line 99 of file DiagnosedSilenceableFailure.h.

References mlir::succeeded().

◆ isDefiniteFailure()

bool mlir::DiagnosedSilenceableFailure::isDefiniteFailure ( ) const
inline

Returns true if this is a definite failure.

Definition at line 80 of file DiagnosedSilenceableFailure.h.

References mlir::failed().

◆ isSilenceableFailure()

bool mlir::DiagnosedSilenceableFailure::isSilenceableFailure ( ) const
inline

Returns true if this is a silenceable failure.

Definition at line 85 of file DiagnosedSilenceableFailure.h.

◆ operator<<() [1/2]

template<typename T >
DiagnosedSilenceableFailure& mlir::DiagnosedSilenceableFailure::operator<< ( T &&  value) &
inline

Streams the given values into the last diagnostic.

Expects this object to be a silenceable failure.

Definition at line 127 of file DiagnosedSilenceableFailure.h.

◆ operator<<() [2/2]

template<typename T >
DiagnosedSilenceableFailure&& mlir::DiagnosedSilenceableFailure::operator<< ( T &&  value) &&
inline

Definition at line 134 of file DiagnosedSilenceableFailure.h.

◆ operator=() [1/2]

DiagnosedSilenceableFailure& mlir::DiagnosedSilenceableFailure::operator= ( const DiagnosedSilenceableFailure )
delete

◆ operator=() [2/2]

DiagnosedSilenceableFailure& mlir::DiagnosedSilenceableFailure::operator= ( DiagnosedSilenceableFailure &&  )
default

◆ silence()

LogicalResult mlir::DiagnosedSilenceableFailure::silence ( )
inline

Converts silenceable failure into LogicalResult success without reporting the diagnostic, preserves the other states.

Definition at line 109 of file DiagnosedSilenceableFailure.h.

References mlir::success().

Referenced by mlir::transform::TransformRewriter::silenceTrackingFailure().

◆ silenceableFailure() [1/2]

static DiagnosedSilenceableFailure mlir::DiagnosedSilenceableFailure::silenceableFailure ( Diagnostic &&  diag)
inlinestatic

Constructs a DiagnosedSilenceableFailure in the silenceable failure state, ready to emit the given diagnostic.

This is considered a failure regardless of the diagnostic severity.

Definition at line 61 of file DiagnosedSilenceableFailure.h.

References diag().

◆ silenceableFailure() [2/2]

static DiagnosedSilenceableFailure mlir::DiagnosedSilenceableFailure::silenceableFailure ( SmallVector< Diagnostic > &&  diag)
inlinestatic

Definition at line 65 of file DiagnosedSilenceableFailure.h.

References diag().

◆ succeeded()

bool mlir::DiagnosedSilenceableFailure::succeeded ( ) const
inline

Returns true if this is a success.

Definition at line 75 of file DiagnosedSilenceableFailure.h.

References mlir::succeeded().

Referenced by mlir::transform::TransformState::applyTransform(), and verifyGpuMapping().

◆ success()

static DiagnosedSilenceableFailure mlir::DiagnosedSilenceableFailure::success ( )
inlinestatic

◆ takeDiagnostics()

void mlir::DiagnosedSilenceableFailure::takeDiagnostics ( SmallVectorImpl< Diagnostic > &  diags)
inline

Take the diagnostics and silence.

Definition at line 118 of file DiagnosedSilenceableFailure.h.


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