MLIR  19.0.0git
Classes | Public Member Functions | List of all members
mlir::python::PyDiagnostic Class Reference

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

#include "Bindings/Python/IRModule.h"


struct  DiagnosticInfo
 Materialized diagnostic information. More...

Public Member Functions

 PyDiagnostic (MlirDiagnostic diagnostic)
void invalidate ()
bool isValid ()
MlirDiagnosticSeverity getSeverity ()
PyLocation getLocation ()
pybind11::str getMessage ()
pybind11::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 349 of file IRModule.h.

Constructor & Destructor Documentation

◆ PyDiagnostic()

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

Definition at line 351 of file IRModule.h.

Referenced by getNotes().

Member Function Documentation

◆ getInfo()

PyDiagnostic::DiagnosticInfo PyDiagnostic::getInfo ( )

Definition at line 1002 of file IRCore.cpp.

References getInfo(), getLocation(), getMessage(), getNotes(), and getSeverity().

Referenced by getInfo().

◆ getLocation()

PyLocation PyDiagnostic::getLocation ( )

◆ getMessage()

py::str PyDiagnostic::getMessage ( )

◆ getNotes()

py::tuple PyDiagnostic::getNotes ( )

Definition at line 989 of file IRCore.cpp.

References mlirDiagnosticGetNote(), mlirDiagnosticGetNumNotes(), and PyDiagnostic().

Referenced by getInfo().

◆ getSeverity()

MlirDiagnosticSeverity PyDiagnostic::getSeverity ( )

Definition at line 969 of file IRCore.cpp.

References mlirDiagnosticGetSeverity().

Referenced by getInfo().

◆ invalidate()

void PyDiagnostic::invalidate ( )

Definition at line 935 of file IRCore.cpp.

References invalidate().

Referenced by mlir::python::PyMlirContext::attachDiagnosticHandler(), and invalidate().

◆ isValid()

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

Definition at line 353 of file IRModule.h.

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