MLIR 24.0.0git
mlir::InFlightDiagnostic Class Reference

This class represents a diagnostic that is inflight and set to be reported. More...

#include "mlir/IR/Diagnostics.h"

Public Member Functions

 InFlightDiagnostic ()=default
 InFlightDiagnostic (InFlightDiagnostic &&rhs)
 ~InFlightDiagnostic ()
template<typename Arg>
InFlightDiagnostic & operator<< (Arg &&arg) &
 Stream operator for new diagnostic arguments.
template<typename Arg>
InFlightDiagnostic && operator<< (Arg &&arg) &&
InFlightDiagnostic & operator<< (InFlightDiagnostic &(*manip)(InFlightDiagnostic &)) &
 Enables stream-style manipulators to be chained into the diagnostic.
InFlightDiagnostic && operator<< (InFlightDiagnostic &(*manip)(InFlightDiagnostic &)) &&
template<typename... Args>
InFlightDiagnostic & append (Args &&...args) &
 Append arguments to the diagnostic.
template<typename... Args>
InFlightDiagnostic && append (Args &&...args) &&
Diagnostic & attachNote (std::optional< Location > noteLoc=std::nullopt)
 Attaches a note to this diagnostic.
Diagnostic * getUnderlyingDiagnostic ()
 Returns the underlying diagnostic or nullptr if this diagnostic isn't active.
void report ()
 Reports the diagnostic to the engine.
void abandon ()
 Abandons this diagnostic so that it will no longer be reported.
 operator LogicalResult () const
 Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
 operator ParseResult () const
 Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
template<typename T>
 operator FailureOr< T > () const
 Allow an inflight diagnostic to be converted to FailureOr<T>.

Friends

InFlightDiagnostic & diag::next (InFlightDiagnostic &diag)

Detailed Description

This class represents a diagnostic that is inflight and set to be reported.

This allows for last minute modifications of the diagnostic before it is emitted by a DiagnosticEngine.

Definition at line 352 of file Diagnostics.h.

Constructor & Destructor Documentation

◆ InFlightDiagnostic() [1/2]

mlir::InFlightDiagnostic::InFlightDiagnostic ( )
default

◆ InFlightDiagnostic() [2/2]

mlir::InFlightDiagnostic::InFlightDiagnostic ( InFlightDiagnostic && rhs)
inline

Definition at line 355 of file Diagnostics.h.

References InFlightDiagnostic().

◆ ~InFlightDiagnostic()

mlir::InFlightDiagnostic::~InFlightDiagnostic ( )
inline

Definition at line 361 of file Diagnostics.h.

References report().

Member Function Documentation

◆ abandon()

void InFlightDiagnostic::abandon ( )

Abandons this diagnostic so that it will no longer be reported.

Abandons this diagnostic.

Definition at line 266 of file Diagnostics.cpp.

◆ append() [1/2]

template<typename... Args>
InFlightDiagnostic & mlir::InFlightDiagnostic::append ( Args &&... args) &
inline

◆ append() [2/2]

template<typename... Args>
InFlightDiagnostic && mlir::InFlightDiagnostic::append ( Args &&... args) &&
inline

Definition at line 396 of file Diagnostics.h.

References append(), and InFlightDiagnostic().

◆ attachNote()

Diagnostic & mlir::InFlightDiagnostic::attachNote ( std::optional< Location > noteLoc = std::nullopt)
inline

◆ getUnderlyingDiagnostic()

Diagnostic * mlir::InFlightDiagnostic::getUnderlyingDiagnostic ( )
inline

Returns the underlying diagnostic or nullptr if this diagnostic isn't active.

Definition at line 408 of file Diagnostics.h.

◆ operator FailureOr< T >()

template<typename T>
mlir::InFlightDiagnostic::operator FailureOr< T > ( ) const
inline

Allow an inflight diagnostic to be converted to FailureOr<T>.

Always results in 'failure' because this cast cannot possibly return an object of 'T'.

Definition at line 428 of file Diagnostics.h.

◆ operator LogicalResult()

InFlightDiagnostic::operator LogicalResult ( ) const

Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.

Definition at line 250 of file Diagnostics.cpp.

◆ operator ParseResult()

mlir::InFlightDiagnostic::operator ParseResult ( ) const
inline

Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.

Definition at line 422 of file Diagnostics.h.

◆ operator<<() [1/4]

template<typename Arg>
InFlightDiagnostic & mlir::InFlightDiagnostic::operator<< ( Arg && arg) &
inline

Stream operator for new diagnostic arguments.

Definition at line 368 of file Diagnostics.h.

References append(), and InFlightDiagnostic().

◆ operator<<() [2/4]

template<typename Arg>
InFlightDiagnostic && mlir::InFlightDiagnostic::operator<< ( Arg && arg) &&
inline

Definition at line 372 of file Diagnostics.h.

References append(), and InFlightDiagnostic().

◆ operator<<() [3/4]

InFlightDiagnostic & mlir::InFlightDiagnostic::operator<< ( InFlightDiagnostic &(* manip )(InFlightDiagnostic &)) &
inline

Enables stream-style manipulators to be chained into the diagnostic.

Definition at line 377 of file Diagnostics.h.

References InFlightDiagnostic().

◆ operator<<() [4/4]

InFlightDiagnostic && mlir::InFlightDiagnostic::operator<< ( InFlightDiagnostic &(* manip )(InFlightDiagnostic &)) &&
inline

Definition at line 382 of file Diagnostics.h.

References InFlightDiagnostic().

◆ report()

void InFlightDiagnostic::report ( )

Reports the diagnostic to the engine.

Definition at line 255 of file Diagnostics.cpp.

Referenced by ~InFlightDiagnostic().

◆ diag::next


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