MLIR 24.0.0git
mlir::pdll::ast::DiagnosticEngine Class Reference

This class manages the construction and emission of PDLL diagnostics. More...

#include "mlir/Tools/PDLL/AST/Diagnostic.h"

Public Types

using HandlerFn = llvm::unique_function<void(Diagnostic &)>
 A function used to handle diagnostics emitted by the engine.

Public Member Functions

InFlightDiagnostic emitError (SMRange loc, const Twine &msg)
 Emit an error to the diagnostic engine.
InFlightDiagnostic emitWarning (SMRange loc, const Twine &msg)
void report (Diagnostic &&diagnostic)
 Report the given diagnostic.
const HandlerFn & getHandlerFn () const
 Get the current handler function of this diagnostic engine.
HandlerFn takeHandlerFn ()
 Take the current handler function, resetting the current handler to null.
void setHandlerFn (HandlerFn &&newHandler)
 Set the handler function for this diagnostic engine.

Detailed Description

This class manages the construction and emission of PDLL diagnostics.

Definition at line 139 of file Diagnostic.h.

Member Typedef Documentation

◆ HandlerFn

A function used to handle diagnostics emitted by the engine.

Definition at line 142 of file Diagnostic.h.

Member Function Documentation

◆ emitError()

InFlightDiagnostic mlir::pdll::ast::DiagnosticEngine::emitError ( SMRange loc,
const Twine & msg )
inline

Emit an error to the diagnostic engine.

Definition at line 145 of file Diagnostic.h.

◆ emitWarning()

InFlightDiagnostic mlir::pdll::ast::DiagnosticEngine::emitWarning ( SMRange loc,
const Twine & msg )
inline

Definition at line 149 of file Diagnostic.h.

◆ getHandlerFn()

const HandlerFn & mlir::pdll::ast::DiagnosticEngine::getHandlerFn ( ) const
inline

Get the current handler function of this diagnostic engine.

Definition at line 161 of file Diagnostic.h.

◆ report()

void mlir::pdll::ast::DiagnosticEngine::report ( Diagnostic && diagnostic)
inline

Report the given diagnostic.

Definition at line 155 of file Diagnostic.h.

◆ setHandlerFn()

void mlir::pdll::ast::DiagnosticEngine::setHandlerFn ( HandlerFn && newHandler)
inline

Set the handler function for this diagnostic engine.

Definition at line 171 of file Diagnostic.h.

◆ takeHandlerFn()

HandlerFn mlir::pdll::ast::DiagnosticEngine::takeHandlerFn ( )
inline

Take the current handler function, resetting the current handler to null.

Definition at line 164 of file Diagnostic.h.


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