LLVM 20.0.0git
|
This is the base class for diagnostic handling in LLVM. More...
#include "llvm/IR/DiagnosticHandler.h"
Public Types | |
using | DiagnosticHandlerTy = void(*)(const DiagnosticInfo *DI, void *Context) |
Public Member Functions | |
DiagnosticHandler (void *DiagContext=nullptr) | |
virtual | ~DiagnosticHandler ()=default |
virtual bool | handleDiagnostics (const DiagnosticInfo &DI) |
Override handleDiagnostics to provide custom implementation. | |
virtual bool | isAnalysisRemarkEnabled (StringRef PassName) const |
Return true if analysis remarks are enabled, override to provide different implementation. | |
virtual bool | isMissedOptRemarkEnabled (StringRef PassName) const |
Return true if missed optimization remarks are enabled, override to provide different implementation. | |
virtual bool | isPassedOptRemarkEnabled (StringRef PassName) const |
Return true if passed optimization remarks are enabled, override to provide different implementation. | |
bool | isAnyRemarkEnabled (StringRef PassName) const |
Return true if any type of remarks are enabled for this pass. | |
virtual bool | isAnyRemarkEnabled () const |
Return true if any type of remarks are enabled for any pass. | |
Public Attributes | |
void * | DiagnosticContext = nullptr |
bool | HasErrors = false |
DiagnosticHandlerTy | DiagHandlerCallback = nullptr |
DiagHandlerCallback is settable from the C API and base implementation of DiagnosticHandler will call it from handleDiagnostics(). | |
This is the base class for diagnostic handling in LLVM.
The handleDiagnostics method must be overriden by the subclasses to handle diagnostic. The *RemarkEnabled methods can be overriden to control which remarks are enabled.
Definition at line 24 of file DiagnosticHandler.h.
using llvm::DiagnosticHandler::DiagnosticHandlerTy = void (*)(const DiagnosticInfo *DI, void *Context) |
Definition at line 31 of file DiagnosticHandler.h.
|
inline |
Definition at line 27 of file DiagnosticHandler.h.
|
virtualdefault |
|
inlinevirtual |
Override handleDiagnostics to provide custom implementation.
Return true if it handles diagnostics reporting properly otherwise return false to make LLVMContext::diagnose() to print the message with a prefix based on the severity.
Reimplemented in llvm::lto::LTOLLVMDiagnosticHandler.
Definition at line 43 of file DiagnosticHandler.h.
References DiagHandlerCallback, and DiagnosticContext.
Return true if analysis remarks are enabled, override to provide different implementation.
Definition at line 71 of file DiagnosticHandler.cpp.
References PassName.
Referenced by isAnyRemarkEnabled(), llvm::MachineOptimizationRemarkAnalysis::isEnabled(), and llvm::OptimizationRemarkAnalysis::isEnabled().
|
virtual |
Return true if any type of remarks are enabled for any pass.
Definition at line 84 of file DiagnosticHandler.cpp.
Return true if any type of remarks are enabled for this pass.
Definition at line 64 of file DiagnosticHandler.h.
References isAnalysisRemarkEnabled(), isMissedOptRemarkEnabled(), isPassedOptRemarkEnabled(), and PassName.
Referenced by llvm::OptimizationRemarkEmitter::allowExtraAnalysis(), llvm::MachineOptimizationRemarkEmitter::allowExtraAnalysis(), llvm::MachineOptimizationRemarkEmitter::emit(), and llvm::OptimizationRemarkEmitter::enabled().
Return true if missed optimization remarks are enabled, override to provide different implementation.
Definition at line 75 of file DiagnosticHandler.cpp.
References PassName.
Referenced by isAnyRemarkEnabled(), llvm::MachineOptimizationRemarkMissed::isEnabled(), and llvm::OptimizationRemarkMissed::isEnabled().
Return true if passed optimization remarks are enabled, override to provide different implementation.
Definition at line 79 of file DiagnosticHandler.cpp.
References PassName.
Referenced by isAnyRemarkEnabled(), llvm::MachineOptimizationRemark::isEnabled(), and llvm::OptimizationRemark::isEnabled().
DiagnosticHandlerTy llvm::DiagnosticHandler::DiagHandlerCallback = nullptr |
DiagHandlerCallback is settable from the C API and base implementation of DiagnosticHandler will call it from handleDiagnostics().
Any derived class of DiagnosticHandler should not use callback but implement handleDiagnostics().
Definition at line 37 of file DiagnosticHandler.h.
Referenced by handleDiagnostics().
void* llvm::DiagnosticHandler::DiagnosticContext = nullptr |
Definition at line 25 of file DiagnosticHandler.h.
Referenced by handleDiagnostics().
bool llvm::DiagnosticHandler::HasErrors = false |
Definition at line 26 of file DiagnosticHandler.h.