My Project
|
#include <Diagnostics.h>
Public Types | |
using | HandlerTy = std::function< LogicalResult(Diagnostic &)> |
using | HandlerID = uint64_t |
A handle to a specific registered handler object. More... | |
Public Member Functions | |
~DiagnosticEngine () | |
HandlerID | registerHandler (const HandlerTy &handler) |
template<typename FuncTy , typename RetT = decltype(std::declval<FuncTy>()( std::declval<Diagnostic &>()))> | |
std::enable_if_t< std::is_same< RetT, void >::value, HandlerID > | registerHandler (FuncTy &&handler) |
void | eraseHandler (HandlerID id) |
Erase the registered diagnostic handler with the given identifier. More... | |
InFlightDiagnostic | emit (Location loc, DiagnosticSeverity severity) |
Create a new inflight diagnostic with the given location and severity. More... | |
void | emit (Diagnostic diag) |
Friends | |
class | MLIRContextImpl |
This class is the main interface for diagnostics. The DiagnosticEngine manages the registration of diagnostic handlers as well as the core API for diagnostic emission. This class should not be constructed directly, but instead interfaced with via an MLIRContext instance.
using mlir::DiagnosticEngine::HandlerID = uint64_t |
A handle to a specific registered handler object.
using mlir::DiagnosticEngine::HandlerTy = std::function<LogicalResult(Diagnostic &)> |
The handler type for MLIR diagnostics. This function takes a diagnostic as input, and returns success if the handler has fully processed this diagnostic. Returns failure otherwise.
DiagnosticEngine::~DiagnosticEngine | ( | ) |
|
inline |
Create a new inflight diagnostic with the given location and severity.
void DiagnosticEngine::emit | ( | Diagnostic | diag | ) |
Emit a diagnostic using the registered issue handler if present, or with the default behavior if not.
void DiagnosticEngine::eraseHandler | ( | HandlerID | id | ) |
Erase the registered diagnostic handler with the given identifier.
auto DiagnosticEngine::registerHandler | ( | const HandlerTy & | handler | ) |
Register a new handler for diagnostics to the engine. Diagnostics are process by handlers in stack-like order, meaning that the last added handlers will process diagnostics first. This function returns a unique identifier for the registered handler, which can be used to unregister this handler at a later time.
Register a new handler for diagnostics to the engine. This function returns a unique identifier for the registered handler, which can be used to unregister this handler at a later time.
|
inline |
Set the diagnostic handler with a function that returns void. This is a convenient wrapper for handlers that always completely process the given diagnostic.
|
friend |