MLIR
20.0.0git
|
#include "mlir-c/Diagnostics.h"
#include "mlir/CAPI/Diagnostics.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Support.h"
#include "mlir/CAPI/Utils.h"
#include "mlir/IR/Diagnostics.h"
Go to the source code of this file.
Functions | |
void | mlirDiagnosticPrint (MlirDiagnostic diagnostic, MlirStringCallback callback, void *userData) |
Prints a diagnostic using the provided callback. More... | |
MlirLocation | mlirDiagnosticGetLocation (MlirDiagnostic diagnostic) |
Returns the location at which the diagnostic is reported. More... | |
MlirDiagnosticSeverity | mlirDiagnosticGetSeverity (MlirDiagnostic diagnostic) |
Returns the severity of the diagnostic. More... | |
intptr_t | mlirDiagnosticGetNumNotes (MlirDiagnostic diagnostic) |
Returns the number of notes attached to the diagnostic. More... | |
MlirDiagnostic | mlirDiagnosticGetNote (MlirDiagnostic diagnostic, intptr_t pos) |
Returns pos -th note attached to the diagnostic. More... | |
static void | deleteUserDataNoop (void *userData) |
MlirDiagnosticHandlerID | mlirContextAttachDiagnosticHandler (MlirContext context, MlirDiagnosticHandler handler, void *userData, void(*deleteUserData)(void *)) |
Attaches the diagnostic handler to the context. More... | |
void | mlirContextDetachDiagnosticHandler (MlirContext context, MlirDiagnosticHandlerID id) |
Detaches an attached diagnostic handler from the context given its identifier. More... | |
void | mlirEmitError (MlirLocation location, const char *message) |
Emits an error at the given location through the diagnostics engine. More... | |
|
static |
Definition at line 54 of file Diagnostics.cpp.
Referenced by mlirContextAttachDiagnosticHandler().
MlirDiagnosticHandlerID mlirContextAttachDiagnosticHandler | ( | MlirContext | context, |
MlirDiagnosticHandler | handler, | ||
void * | userData, | ||
void(*)(void *) | deleteUserData | ||
) |
Attaches the diagnostic handler to the context.
Handlers are invoked in the reverse order of attachment until one of them processes the diagnostic completely. When a handler is invoked it is passed the userData
that was provided when it was attached. If non-NULL, deleteUserData
is called once the system no longer needs to call the handler (for instance after the handler is detached or the context is destroyed). Returns an identifier that can be used to detach the handler.
Definition at line 56 of file Diagnostics.cpp.
References deleteUserDataNoop(), unwrap(), and wrap().
Referenced by mlir::python::PyMlirContext::attachDiagnosticHandler(), and mlir::python::CollectDiagnosticsToStringScope::CollectDiagnosticsToStringScope().
void mlirContextDetachDiagnosticHandler | ( | MlirContext | context, |
MlirDiagnosticHandlerID | id | ||
) |
Detaches an attached diagnostic handler from the context given its identifier.
Definition at line 72 of file Diagnostics.cpp.
References unwrap().
Referenced by mlir::python::PyDiagnosticHandler::detach(), mlir::python::CollectDiagnosticsToStringScope::~CollectDiagnosticsToStringScope(), and mlir::python::PyMlirContext::ErrorCapture::~ErrorCapture().
MlirLocation mlirDiagnosticGetLocation | ( | MlirDiagnostic | diagnostic | ) |
Returns the location at which the diagnostic is reported.
Definition at line 24 of file Diagnostics.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::PyDiagnostic::getLocation().
MlirDiagnostic mlirDiagnosticGetNote | ( | MlirDiagnostic | diagnostic, |
intptr_t | pos | ||
) |
Returns pos
-th note attached to the diagnostic.
Expects pos
to be a valid zero-based index into the list of notes.
Definition at line 50 of file Diagnostics.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::PyDiagnostic::getNotes().
intptr_t mlirDiagnosticGetNumNotes | ( | MlirDiagnostic | diagnostic | ) |
Returns the number of notes attached to the diagnostic.
Definition at line 44 of file Diagnostics.cpp.
References unwrap().
Referenced by mlir::python::PyDiagnostic::getNotes().
MlirDiagnosticSeverity mlirDiagnosticGetSeverity | ( | MlirDiagnostic | diagnostic | ) |
Returns the severity of the diagnostic.
Definition at line 28 of file Diagnostics.cpp.
References mlir::Error, MlirDiagnosticError, MlirDiagnosticNote, MlirDiagnosticRemark, MlirDiagnosticWarning, mlir::Note, mlir::Remark, unwrap(), and mlir::Warning.
Referenced by mlir::python::PyDiagnostic::getSeverity().
void mlirDiagnosticPrint | ( | MlirDiagnostic | diagnostic, |
MlirStringCallback | callback, | ||
void * | userData | ||
) |
Prints a diagnostic using the provided callback.
Definition at line 18 of file Diagnostics.cpp.
References mlir::Diagnostic::print(), and unwrap().
Referenced by mlir::python::PyDiagnostic::getMessage().
void mlirEmitError | ( | MlirLocation | location, |
const char * | message | ||
) |
Emits an error at the given location through the diagnostics engine.
Used for testing purposes.
Definition at line 78 of file Diagnostics.cpp.
References mlir::emitError(), and unwrap().