MLIR 23.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic Class Reference

Python class mirroring the C MlirDiagnostic struct. More...

#include "mlir/Bindings/Python/IRCore.h"

Classes

struct  DiagnosticInfo
 Materialized diagnostic information. More...

Public Member Functions

 PyDiagnostic (MlirDiagnostic diagnostic)
void invalidate ()
bool isValid ()
PyDiagnosticSeverity getSeverity ()
PyLocation getLocation ()
nanobind::str getMessage ()
nanobind::tuple getNotes ()
DiagnosticInfo getInfo ()

Detailed Description

Python class mirroring the C MlirDiagnostic struct.

Note that these structs are only valid for the duration of a diagnostic callback and attempting to access them outside of that will raise an exception. This applies to nested diagnostics (in the notes) as well.

Definition at line 356 of file IRCore.h.

Constructor & Destructor Documentation

◆ PyDiagnostic()

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::PyDiagnostic ( MlirDiagnostic diagnostic)
inline

Definition at line 358 of file IRCore.h.

Referenced by invalidate().

Member Function Documentation

◆ getInfo()

PyDiagnostic::DiagnosticInfo mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::getInfo ( )

Definition at line 808 of file IRCore.cpp.

◆ getLocation()

PyLocation mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::getLocation ( )

◆ getMessage()

nb::str mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::getMessage ( )

◆ getNotes()

nb::tuple mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::getNotes ( )

◆ getSeverity()

PyDiagnosticSeverity mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::getSeverity ( )

◆ invalidate()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::invalidate ( )

Definition at line 737 of file IRCore.cpp.

References PyDiagnostic().

◆ isValid()

bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDiagnostic::isValid ( )
inline

Definition at line 360 of file IRCore.h.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().


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