LLVM
8.0.1
|
Common features for diagnostics with an associated location. More...
#include "llvm/IR/DiagnosticInfo.h"
Public Member Functions | |
DiagnosticInfoWithLocationBase (enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const Function &Fn, const DiagnosticLocation &Loc) | |
Fn is the function where the diagnostic is being emitted. More... | |
bool | isLocationAvailable () const |
Return true if location information is available for this diagnostic. More... | |
const std::string | getLocationStr () const |
Return a string with the location information for this diagnostic in the format "file:line:col". More... | |
void | getLocation (StringRef &RelativePath, unsigned &Line, unsigned &Column) const |
Return location information for this diagnostic in three parts: the relative source file path, line number and column. More... | |
std::string | getAbsolutePath () const |
Return the absolute path tot the file. More... | |
const Function & | getFunction () const |
DiagnosticLocation | getLocation () const |
Public Member Functions inherited from llvm::DiagnosticInfo | |
DiagnosticInfo (int Kind, DiagnosticSeverity Severity) | |
virtual | ~DiagnosticInfo ()=default |
int | getKind () const |
DiagnosticSeverity | getSeverity () const |
virtual void | print (DiagnosticPrinter &DP) const =0 |
Print using the given DP a user-friendly message. More... | |
Common features for diagnostics with an associated location.
Definition at line 364 of file DiagnosticInfo.h.
|
inline |
Fn
is the function where the diagnostic is being emitted.
Loc
is the location information to use in the diagnostic.
Definition at line 369 of file DiagnosticInfo.h.
std::string DiagnosticInfoWithLocationBase::getAbsolutePath | ( | ) | const |
Return the absolute path tot the file.
Definition at line 143 of file DiagnosticInfo.cpp.
Definition at line 391 of file DiagnosticInfo.h.
Referenced by llvm::DiagnosticInfoOptimizationBase::getMsg(), llvm::MachineOptimizationRemark::isEnabled(), llvm::MachineOptimizationRemarkMissed::isEnabled(), llvm::MachineOptimizationRemarkAnalysis::isEnabled(), llvm::OptimizationRemark::isEnabled(), llvm::OptimizationRemarkMissed::isEnabled(), llvm::OptimizationRemarkAnalysis::isEnabled(), llvm::DiagnosticInfoISelFallback::print(), and llvm::DiagnosticInfoUnsupported::print().
void DiagnosticInfoWithLocationBase::getLocation | ( | StringRef & | RelativePath, |
unsigned & | Line, | ||
unsigned & | Column | ||
) | const |
Return location information for this diagnostic in three parts: the relative source file path, line number and column.
Definition at line 147 of file DiagnosticInfo.cpp.
Referenced by llvm::DiagnosticInfoOptimizationBase::getMsg(), reportFastISelFailure(), and llvm::reportGISelFailure().
|
inline |
Definition at line 392 of file DiagnosticInfo.h.
const std::string DiagnosticInfoWithLocationBase::getLocationStr | ( | ) | const |
Return a string with the location information for this diagnostic in the format "file:line:col".
If location information is not available, it returns "<unknown>:0:0".
Definition at line 155 of file DiagnosticInfo.cpp.
References getLocation().
Referenced by llvm::DiagnosticInfoOptimizationBase::print(), and llvm::DiagnosticInfoUnsupported::print().
|
inline |
Return true if location information is available for this diagnostic.
Definition at line 376 of file DiagnosticInfo.h.
References getLocation().