|
LLVM 22.0.0git
|
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic. More...
#include "llvm/Support/SourceMgr.h"
Public Member Functions | |
| SMDiagnostic ()=default | |
| SMDiagnostic (StringRef filename, SourceMgr::DiagKind Knd, StringRef Msg) | |
| LLVM_ABI | SMDiagnostic (const SourceMgr &sm, SMLoc L, StringRef FN, int Line, int Col, SourceMgr::DiagKind Kind, StringRef Msg, StringRef LineStr, ArrayRef< std::pair< unsigned, unsigned > > Ranges, ArrayRef< SMFixIt > FixIts={}) |
| const SourceMgr * | getSourceMgr () const |
| SMLoc | getLoc () const |
| StringRef | getFilename () const |
| int | getLineNo () const |
| int | getColumnNo () const |
| SourceMgr::DiagKind | getKind () const |
| StringRef | getMessage () const |
| StringRef | getLineContents () const |
| ArrayRef< std::pair< unsigned, unsigned > > | getRanges () const |
| void | addFixIt (const SMFixIt &Hint) |
| ArrayRef< SMFixIt > | getFixIts () const |
| LLVM_ABI void | print (const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true, bool ShowLocation=true) const |
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic.
Definition at line 297 of file SourceMgr.h.
|
default |
|
inline |
Definition at line 312 of file SourceMgr.h.
| SMDiagnostic::SMDiagnostic | ( | const SourceMgr & | sm, |
| SMLoc | L, | ||
| StringRef | FN, | ||
| int | Line, | ||
| int | Col, | ||
| SourceMgr::DiagKind | Kind, | ||
| StringRef | Msg, | ||
| StringRef | LineStr, | ||
| ArrayRef< std::pair< unsigned, unsigned > > | Ranges, | ||
| ArrayRef< SMFixIt > | FixIts = {} ) |
Definition at line 398 of file SourceMgr.cpp.
References llvm::sort().
Definition at line 332 of file SourceMgr.h.
|
inline |
Definition at line 326 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 324 of file SourceMgr.h.
Definition at line 334 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 327 of file SourceMgr.h.
Referenced by DiagHandler(), and llvm::MIRParserImpl::reportDiagnostic().
|
inline |
Definition at line 329 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 325 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 323 of file SourceMgr.h.
Referenced by DiagHandler(), and llvm::SourceMgr::PrintMessage().
|
inline |
Definition at line 328 of file SourceMgr.h.
Referenced by DiagHandler(), and llvm::DWARFYAML::emitDebugSections().
Definition at line 330 of file SourceMgr.h.
Referenced by DiagHandler().
Definition at line 322 of file SourceMgr.h.
Referenced by DiagHandler().
| void SMDiagnostic::print | ( | const char * | ProgName, |
| raw_ostream & | S, | ||
| bool | ShowColors = true, | ||
| bool | ShowKindLabel = true, | ||
| bool | ShowLocation = true ) const |
Definition at line 504 of file SourceMgr.cpp.
References llvm::any_of(), llvm::ArrayRef(), llvm::Auto, buildFixItLine(), llvm::Disable, llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::SourceMgr::DK_Remark, llvm::SourceMgr::DK_Warning, llvm::WithColor::error(), llvm::raw_ostream::GREEN, isNonASCII(), llvm::WithColor::note(), printSourceLine(), llvm::WithColor::remark(), llvm::raw_ostream::SAVEDCOLOR, TabStop, and llvm::WithColor::warning().
Referenced by defaultDiagHandler(), DiagHandler(), handleDiagnostic(), LLVMParseIRInContext(), llvm::DiagnosticPrinterRawOStream::operator<<(), and llvm::SourceMgr::PrintMessage().