MLIR  19.0.0git
Public Types | Public Member Functions | List of all members
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. More...
 

Public Member Functions

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

Detailed Description

This class manages the construction and emission of PDLL diagnostics.

Definition at line 140 of file Diagnostic.h.

Member Typedef Documentation

◆ HandlerFn

using mlir::pdll::ast::DiagnosticEngine::HandlerFn = llvm::unique_function<void(Diagnostic &)>

A function used to handle diagnostics emitted by the engine.

Definition at line 143 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 146 of file Diagnostic.h.

Referenced by mlir::pdll::Lexer::emitError(), and mlir::pdll::Lexer::emitErrorAndNote().

◆ emitWarning()

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

Definition at line 150 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 162 of file Diagnostic.h.

Referenced by mlir::pdll::Lexer::Lexer().

◆ report()

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

Report the given diagnostic.

Definition at line 156 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 172 of file Diagnostic.h.

Referenced by mlir::pdll::Lexer::Lexer(), and mlir::pdll::Lexer::~Lexer().

◆ takeHandlerFn()

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

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

Definition at line 165 of file Diagnostic.h.


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