MLIR
20.0.0git
|
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. More... | |
template<typename Arg > | |
InFlightDiagnostic && | operator<< (Arg &&arg) && |
template<typename... Args> | |
InFlightDiagnostic & | append (Args &&...args) & |
Append arguments to the diagnostic. More... | |
template<typename... Args> | |
InFlightDiagnostic && | append (Args &&...args) && |
Diagnostic & | attachNote (std::optional< Location > noteLoc=std::nullopt) |
Attaches a note to this diagnostic. More... | |
Diagnostic * | getUnderlyingDiagnostic () |
Returns the underlying diagnostic or nullptr if this diagnostic isn't active. More... | |
void | report () |
Reports the diagnostic to the engine. More... | |
void | abandon () |
Abandons this diagnostic so that it will no longer be reported. More... | |
operator LogicalResult () const | |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic. More... | |
operator ParseResult () const | |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic. More... | |
template<typename T > | |
operator FailureOr< T > () const | |
Allow an inflight diagnostic to be converted to FailureOr<T>. More... | |
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 314 of file Diagnostics.h.
|
default |
|
inline |
Definition at line 317 of file Diagnostics.h.
|
inline |
Definition at line 323 of file Diagnostics.h.
References report().
void InFlightDiagnostic::abandon | ( | ) |
Abandons this diagnostic so that it will no longer be reported.
Abandons this diagnostic.
Definition at line 217 of file Diagnostics.cpp.
|
inline |
Append arguments to the diagnostic.
Definition at line 340 of file Diagnostics.h.
Referenced by append(), mlir::emitOptionalError(), mlir::emitOptionalRemark(), mlir::emitOptionalWarning(), operator<<(), and mlir::detail::verifySymbolTable().
|
inline |
Definition at line 347 of file Diagnostics.h.
References append().
|
inline |
Attaches a note to this diagnostic.
Definition at line 352 of file Diagnostics.h.
Referenced by mlir::DiagnosedDefiniteFailure::attachNote(), mlir::detail::Parser::parseFloatFromIntegerLiteral(), and mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait().
|
inline |
Returns the underlying diagnostic or nullptr if this diagnostic isn't active.
Definition at line 359 of file Diagnostics.h.
|
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 379 of file Diagnostics.h.
InFlightDiagnostic::operator LogicalResult | ( | ) | const |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
Definition at line 201 of file Diagnostics.cpp.
|
inline |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
Definition at line 373 of file Diagnostics.h.
|
inline |
Stream operator for new diagnostic arguments.
Definition at line 330 of file Diagnostics.h.
References append().
|
inline |
Definition at line 334 of file Diagnostics.h.
References append().
void InFlightDiagnostic::report | ( | ) |
Reports the diagnostic to the engine.
Definition at line 206 of file Diagnostics.cpp.
References mlir::DiagnosticEngine::emit().
Referenced by mlir::DiagnosedDefiniteFailure::operator DiagnosedSilenceableFailure(), mlir::DiagnosedDefiniteFailure::operator LogicalResult(), and ~InFlightDiagnostic().