My Project
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mlir::SourceMgrDiagnosticHandler Class Reference

This class is a utility diagnostic handler for use with llvm::SourceMgr. More...

#include <Diagnostics.h>

Inheritance diagram for mlir::SourceMgrDiagnosticHandler:
Inheritance graph
[legend]
Collaboration diagram for mlir::SourceMgrDiagnosticHandler:
Collaboration graph
[legend]

Public Member Functions

 SourceMgrDiagnosticHandler (llvm::SourceMgr &mgr, MLIRContext *ctx, raw_ostream &os)
 
 SourceMgrDiagnosticHandler (llvm::SourceMgr &mgr, MLIRContext *ctx)
 
 ~SourceMgrDiagnosticHandler ()
 
void emitDiagnostic (Location loc, Twine message, DiagnosticSeverity kind)
 Emit the given diagnostic information with the held source manager. More...
 
- Public Member Functions inherited from mlir::ScopedDiagnosticHandler
 ScopedDiagnosticHandler (MLIRContext *ctx)
 
template<typename FuncTy >
 ScopedDiagnosticHandler (MLIRContext *ctx, FuncTy &&handler)
 
 ~ScopedDiagnosticHandler ()
 

Protected Member Functions

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 one is not found. More...
 
- Protected Member Functions inherited from mlir::ScopedDiagnosticHandler
template<typename FuncTy >
void setHandler (FuncTy &&handler)
 Set the handler to manage via RAII. More...
 

Protected Attributes

llvm::SourceMgr & mgr
 The source manager that we are wrapping. More...
 
raw_ostream & os
 The output stream to use when printing diagnostics. More...
 

Detailed Description

This class is a utility diagnostic handler for use with llvm::SourceMgr.

Constructor & Destructor Documentation

◆ SourceMgrDiagnosticHandler() [1/2]

SourceMgrDiagnosticHandler::SourceMgrDiagnosticHandler ( llvm::SourceMgr &  mgr,
MLIRContext ctx,
raw_ostream &  os 
)

◆ SourceMgrDiagnosticHandler() [2/2]

SourceMgrDiagnosticHandler::SourceMgrDiagnosticHandler ( llvm::SourceMgr &  mgr,
MLIRContext ctx 
)

◆ ~SourceMgrDiagnosticHandler()

SourceMgrDiagnosticHandler::~SourceMgrDiagnosticHandler ( )

Member Function Documentation

◆ emitDiagnostic() [1/2]

void SourceMgrDiagnosticHandler::emitDiagnostic ( Location  loc,
Twine  message,
DiagnosticSeverity  kind 
)

Emit the given diagnostic information with the held source manager.

◆ emitDiagnostic() [2/2]

void SourceMgrDiagnosticHandler::emitDiagnostic ( Diagnostic diag)
protected

Emit the given diagnostic with the held source manager.

◆ getBufferForFile()

const llvm::MemoryBuffer * SourceMgrDiagnosticHandler::getBufferForFile ( StringRef  filename)
protected

Get a memory buffer for the given file, or nullptr if one is not found.

Get a memory buffer for the given file, or nullptr if no file is available.

Member Data Documentation

◆ mgr

llvm::SourceMgr& mlir::SourceMgrDiagnosticHandler::mgr
protected

The source manager that we are wrapping.

◆ os

raw_ostream& mlir::SourceMgrDiagnosticHandler::os
protected

The output stream to use when printing diagnostics.


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