MLIR  19.0.0git
Public Types | Public Member Functions | List of all members
mlir::pdll::ast::Diagnostic Class Reference

This class provides a simple implementation of a PDLL diagnostic. More...

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

Public Types

using Severity = llvm::SourceMgr::DiagKind
 

Public Member Functions

Severity getSeverity () const
 Return the severity of this diagnostic. More...
 
StringRef getMessage () const
 Return the message of this diagnostic. More...
 
SMRange getLocation () const
 Return the location of this diagnostic. More...
 
auto getNotes () const
 Return the notes of this diagnostic. More...
 
DiagnosticattachNote (const Twine &msg, std::optional< SMRange > noteLoc=std::nullopt)
 Attach a note to this diagnostic. More...
 
 operator LogicalResult () const
 Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic. More...
 

Detailed Description

This class provides a simple implementation of a PDLL diagnostic.

Definition at line 30 of file Diagnostic.h.

Member Typedef Documentation

◆ Severity

using mlir::pdll::ast::Diagnostic::Severity = llvm::SourceMgr::DiagKind

Definition at line 32 of file Diagnostic.h.

Member Function Documentation

◆ attachNote()

Diagnostic& mlir::pdll::ast::Diagnostic::attachNote ( const Twine &  msg,
std::optional< SMRange >  noteLoc = std::nullopt 
)
inline

Attach a note to this diagnostic.

Definition at line 47 of file Diagnostic.h.

References getSeverity().

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

◆ getLocation()

SMRange mlir::pdll::ast::Diagnostic::getLocation ( ) const
inline

Return the location of this diagnostic.

Definition at line 41 of file Diagnostic.h.

◆ getMessage()

StringRef mlir::pdll::ast::Diagnostic::getMessage ( ) const
inline

Return the message of this diagnostic.

Definition at line 38 of file Diagnostic.h.

◆ getNotes()

auto mlir::pdll::ast::Diagnostic::getNotes ( ) const
inline

Return the notes of this diagnostic.

Definition at line 44 of file Diagnostic.h.

◆ getSeverity()

Severity mlir::pdll::ast::Diagnostic::getSeverity ( ) const
inline

Return the severity of this diagnostic.

Definition at line 35 of file Diagnostic.h.

Referenced by attachNote().

◆ operator LogicalResult()

mlir::pdll::ast::Diagnostic::operator LogicalResult ( ) const
inline

Allow an inflight diagnostic to be converted to 'failure', otherwise 'success' if this is an empty diagnostic.

Definition at line 58 of file Diagnostic.h.

References mlir::failure().


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