MLIR
21.0.0git
|
This class is a utility diagnostic handler for use with llvm::SourceMgr that verifies that emitted diagnostics match 'expected-*' lines on the corresponding line of the source file. More...
#include "mlir/IR/Diagnostics.h"
Public Member Functions | |
SourceMgrDiagnosticVerifierHandler (llvm::SourceMgr &srcMgr, MLIRContext *ctx, raw_ostream &out) | |
SourceMgrDiagnosticVerifierHandler (llvm::SourceMgr &srcMgr, MLIRContext *ctx) | |
~SourceMgrDiagnosticVerifierHandler () | |
LogicalResult | verify () |
Returns the status of the handler and verifies that all expected diagnostics were emitted. More... | |
![]() | |
SourceMgrDiagnosticHandler (llvm::SourceMgr &mgr, MLIRContext *ctx, raw_ostream &os, ShouldShowLocFn &&shouldShowLocFn={}) | |
SourceMgrDiagnosticHandler (llvm::SourceMgr &mgr, MLIRContext *ctx, ShouldShowLocFn &&shouldShowLocFn={}) | |
~SourceMgrDiagnosticHandler () | |
void | emitDiagnostic (Location loc, Twine message, DiagnosticSeverity kind, bool displaySourceLine=true) |
Emit the given diagnostic information with the held source manager. More... | |
void | setCallStackLimit (unsigned limit) |
Set the maximum depth that a call stack will be printed. Defaults to 10. More... | |
![]() | |
ScopedDiagnosticHandler (MLIRContext *ctx) | |
template<typename FuncTy > | |
ScopedDiagnosticHandler (MLIRContext *ctx, FuncTy &&handler) | |
~ScopedDiagnosticHandler () | |
Additional Inherited Members | |
![]() | |
using | ShouldShowLocFn = llvm::unique_function< bool(Location)> |
This type represents a functor used to filter out locations when printing a diagnostic. More... | |
![]() | |
void | emitDiagnostic (Diagnostic &diag) |
Emit the given diagnostic with the held source manager. More... | |
const llvm::MemoryBuffer * | getBufferForFile (StringRef filename) |
Get a memory buffer for the given file, or nullptr if no file is available. More... | |
![]() | |
template<typename FuncTy > | |
void | setHandler (FuncTy &&handler) |
Set the handler to manage via RAII. More... | |
![]() | |
llvm::SourceMgr & | mgr |
The source manager that we are wrapping. More... | |
raw_ostream & | os |
The output stream to use when printing diagnostics. More... | |
ShouldShowLocFn | shouldShowLocFn |
A functor used when determining if a location for a diagnostic should be shown. More... | |
This class is a utility diagnostic handler for use with llvm::SourceMgr that verifies that emitted diagnostics match 'expected-*' lines on the corresponding line of the source file.
Definition at line 627 of file Diagnostics.h.
SourceMgrDiagnosticVerifierHandler::SourceMgrDiagnosticVerifierHandler | ( | llvm::SourceMgr & | srcMgr, |
MLIRContext * | ctx, | ||
raw_ostream & | out | ||
) |
Definition at line 797 of file Diagnostics.cpp.
References diag(), mlir::SourceMgrDiagnosticHandler::mgr, and mlir::ScopedDiagnosticHandler::setHandler().
SourceMgrDiagnosticVerifierHandler::SourceMgrDiagnosticVerifierHandler | ( | llvm::SourceMgr & | srcMgr, |
MLIRContext * | ctx | ||
) |
Definition at line 817 of file Diagnostics.cpp.
SourceMgrDiagnosticVerifierHandler::~SourceMgrDiagnosticVerifierHandler | ( | ) |
Definition at line 821 of file Diagnostics.cpp.
References verify().
LogicalResult SourceMgrDiagnosticVerifierHandler::verify | ( | ) |
Returns the status of the handler and verifies that all expected diagnostics were emitted.
Returns the status of the verifier and verifies that all expected diagnostics were emitted.
This return success if all diagnostics were verified correctly, failure otherwise.
Definition at line 829 of file Diagnostics.cpp.
References getDiagKindStr(), mlir::SourceMgrDiagnosticHandler::mgr, and mlir::SourceMgrDiagnosticHandler::os.
Referenced by ~SourceMgrDiagnosticVerifierHandler().