MLIR  19.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
mlir::detail::ParallelDiagnosticHandlerImpl Struct Reference
+ Inheritance diagram for mlir::detail::ParallelDiagnosticHandlerImpl:

Classes

struct  ThreadDiagnostic
 

Public Member Functions

 ParallelDiagnosticHandlerImpl (MLIRContext *ctx)
 
 ~ParallelDiagnosticHandlerImpl () override
 
void emitDiagnostics (llvm::function_ref< void(Diagnostic &)> emitFn) const
 Utility method to emit any held diagnostics. More...
 
void setOrderIDForThread (size_t orderID)
 Set the order id for the current thread. More...
 
void eraseOrderIDForThread ()
 Remove the order id for the current thread. More...
 
void print (raw_ostream &os) const override
 Dump the current diagnostics that were inflight. More...
 

Public Attributes

llvm::sys::SmartMutex< true > mutex
 A smart mutex to lock access to the internal state. More...
 
DenseMap< uint64_t, size_t > threadToOrderID
 A mapping between the thread id and the current order id. More...
 
std::vector< ThreadDiagnosticdiagnostics
 An unordered list of diagnostics that were emitted. More...
 
DiagnosticEngine::HandlerID handlerID = 0
 The unique id for the parallel handler. More...
 
MLIRContextcontext
 The context to emit the diagnostics to. More...
 

Detailed Description

Definition at line 903 of file Diagnostics.cpp.

Constructor & Destructor Documentation

◆ ParallelDiagnosticHandlerImpl()

mlir::detail::ParallelDiagnosticHandlerImpl::ParallelDiagnosticHandlerImpl ( MLIRContext ctx)
inline

◆ ~ParallelDiagnosticHandlerImpl()

mlir::detail::ParallelDiagnosticHandlerImpl::~ParallelDiagnosticHandlerImpl ( )
inlineoverride

Member Function Documentation

◆ emitDiagnostics()

void mlir::detail::ParallelDiagnosticHandlerImpl::emitDiagnostics ( llvm::function_ref< void(Diagnostic &)>  emitFn) const
inline

Utility method to emit any held diagnostics.

Definition at line 949 of file Diagnostics.cpp.

References diag(), and diagnostics.

Referenced by print(), and ~ParallelDiagnosticHandlerImpl().

◆ eraseOrderIDForThread()

void mlir::detail::ParallelDiagnosticHandlerImpl::eraseOrderIDForThread ( )
inline

Remove the order id for the current thread.

Definition at line 968 of file Diagnostics.cpp.

References mutex, and threadToOrderID.

◆ print()

void mlir::detail::ParallelDiagnosticHandlerImpl::print ( raw_ostream &  os) const
inlineoverride

Dump the current diagnostics that were inflight.

Definition at line 975 of file Diagnostics.cpp.

References diag(), diagnostics, and emitDiagnostics().

◆ setOrderIDForThread()

void mlir::detail::ParallelDiagnosticHandlerImpl::setOrderIDForThread ( size_t  orderID)
inline

Set the order id for the current thread.

Definition at line 961 of file Diagnostics.cpp.

References mutex, and threadToOrderID.

Member Data Documentation

◆ context

MLIRContext* mlir::detail::ParallelDiagnosticHandlerImpl::context

The context to emit the diagnostics to.

Definition at line 1019 of file Diagnostics.cpp.

Referenced by ~ParallelDiagnosticHandlerImpl().

◆ diagnostics

std::vector<ThreadDiagnostic> mlir::detail::ParallelDiagnosticHandlerImpl::diagnostics
mutable

An unordered list of diagnostics that were emitted.

Definition at line 1013 of file Diagnostics.cpp.

Referenced by emitDiagnostics(), ParallelDiagnosticHandlerImpl(), print(), and ~ParallelDiagnosticHandlerImpl().

◆ handlerID

DiagnosticEngine::HandlerID mlir::detail::ParallelDiagnosticHandlerImpl::handlerID = 0

The unique id for the parallel handler.

Definition at line 1016 of file Diagnostics.cpp.

Referenced by ParallelDiagnosticHandlerImpl(), and ~ParallelDiagnosticHandlerImpl().

◆ mutex

llvm::sys::SmartMutex<true> mlir::detail::ParallelDiagnosticHandlerImpl::mutex

A smart mutex to lock access to the internal state.

Definition at line 1007 of file Diagnostics.cpp.

Referenced by eraseOrderIDForThread(), ParallelDiagnosticHandlerImpl(), and setOrderIDForThread().

◆ threadToOrderID

DenseMap<uint64_t, size_t> mlir::detail::ParallelDiagnosticHandlerImpl::threadToOrderID

A mapping between the thread id and the current order id.

Definition at line 1010 of file Diagnostics.cpp.

Referenced by eraseOrderIDForThread(), ParallelDiagnosticHandlerImpl(), and setOrderIDForThread().


The documentation for this struct was generated from the following file: