Wrapper around InFlightDiagnostic that can either be a regular InFlightDiagnostic or a special version that asserts false after reporting the diagnostic.
More...
#include <ErrorHelper.h>
Wrapper around InFlightDiagnostic that can either be a regular InFlightDiagnostic or a special version that asserts false after reporting the diagnostic.
See wrapNullableInFlightDiagnostic() below for details.
Definition at line 26 of file ErrorHelper.h.
◆ InFlightDiagnosticWrapper() [1/5]
| llzk::InFlightDiagnosticWrapper::InFlightDiagnosticWrapper |
( |
mlir::InFlightDiagnostic && | diag | ) |
|
|
inlineexplicit |
Constructor for regular InFlightDiagnostic.
Definition at line 57 of file ErrorHelper.h.
◆ InFlightDiagnosticWrapper() [2/5]
| llzk::InFlightDiagnosticWrapper::InFlightDiagnosticWrapper |
( |
mlir::MLIRContext * | ctx | ) |
|
|
inlineexplicit |
Constructor for DefaultAndFailInFlightDiagnostic from MLIRContext.
NOTE: This is not a common use case since it will always result in an assertion failure immediately after reporting the error; likely only useful in custom type builders.
Definition at line 62 of file ErrorHelper.h.
◆ InFlightDiagnosticWrapper() [3/5]
| llzk::InFlightDiagnosticWrapper::InFlightDiagnosticWrapper |
( |
const mlir::Location & | loc | ) |
|
|
inlineexplicit |
Constructor for DefaultAndFailInFlightDiagnostic from Location.
NOTE: This is not a common use case since it will always result in an assertion failure immediately after reporting the error; likely only useful in custom type builders.
Definition at line 70 of file ErrorHelper.h.
◆ InFlightDiagnosticWrapper() [4/5]
◆ InFlightDiagnosticWrapper() [5/5]
◆ abandon()
| void llzk::InFlightDiagnosticWrapper::abandon |
( |
| ) |
|
|
inline |
Abandons this diagnostic so that it will no longer be reported.
Definition at line 119 of file ErrorHelper.h.
◆ append() [1/2]
template<typename... Args>
Append arguments to the diagnostic.
Definition at line 90 of file ErrorHelper.h.
◆ append() [2/2]
template<typename... Args>
Append arguments to the diagnostic.
Definition at line 95 of file ErrorHelper.h.
◆ attachNote()
| mlir::Diagnostic & llzk::InFlightDiagnosticWrapper::attachNote |
( |
std::optional< mlir::Location > | noteLoc = std::nullopt | ) |
|
|
inline |
Attaches a note to this diagnostic.
Definition at line 100 of file ErrorHelper.h.
◆ createSilent()
Construct a silent diagnostic that does nothing when appended to or reported.
Definition at line 74 of file ErrorHelper.h.
◆ getUnderlyingDiagnostic()
| mlir::Diagnostic * llzk::InFlightDiagnosticWrapper::getUnderlyingDiagnostic |
( |
| ) |
|
|
inline |
Returns the underlying diagnostic or nullptr if this diagnostic isn't active.
Definition at line 107 of file ErrorHelper.h.
◆ operator mlir::FailureOr< T >()
template<typename T>
| llzk::InFlightDiagnosticWrapper::operator mlir::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 135 of file ErrorHelper.h.
◆ operator mlir::LogicalResult()
| llzk::InFlightDiagnosticWrapper::operator mlir::LogicalResult |
( |
| ) |
const |
|
inline |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
Definition at line 125 of file ErrorHelper.h.
◆ operator mlir::ParseResult()
| llzk::InFlightDiagnosticWrapper::operator mlir::ParseResult |
( |
| ) |
const |
|
inline |
Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.
Definition at line 131 of file ErrorHelper.h.
◆ operator<<() [1/2]
Stream operator for new diagnostic arguments.
Definition at line 81 of file ErrorHelper.h.
◆ operator<<() [2/2]
Stream operator for new diagnostic arguments.
Definition at line 85 of file ErrorHelper.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ report()
| void llzk::InFlightDiagnosticWrapper::report |
( |
| ) |
|
|
inline |
Reports the diagnostic to the engine.
Definition at line 114 of file ErrorHelper.h.
The documentation for this class was generated from the following file: