LLVM 20.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) | |
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 |
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 281 of file SourceMgr.h.
|
default |
|
inline |
Definition at line 296 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 378 of file SourceMgr.cpp.
References llvm::sort(), and string.
Definition at line 315 of file SourceMgr.h.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
Definition at line 309 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 307 of file SourceMgr.h.
Definition at line 317 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 310 of file SourceMgr.h.
Referenced by DiagHandler(), and llvm::MIRParserImpl::reportDiagnostic().
|
inline |
Definition at line 312 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 308 of file SourceMgr.h.
Referenced by DiagHandler().
|
inline |
Definition at line 306 of file SourceMgr.h.
Referenced by DiagHandler(), and llvm::SourceMgr::PrintMessage().
|
inline |
Definition at line 311 of file SourceMgr.h.
Referenced by DiagHandler(), llvm::DWARFYAML::emitDebugSections(), and llvm::ErrorDiagnostic::getMessage().
Definition at line 313 of file SourceMgr.h.
Referenced by DiagHandler().
Definition at line 305 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 484 of file SourceMgr.cpp.
References llvm::any_of(), 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::SMLoc::getPointer(), llvm::raw_ostream::GREEN, isNonASCII(), llvm::WithColor::note(), OS, printSourceLine(), llvm::WithColor::remark(), llvm::raw_ostream::SAVEDCOLOR, TabStop, and llvm::WithColor::warning().
Referenced by defaultDiagHandler(), DiagHandler(), handleDiagnostic(), LLVMParseIRInContext(), llvm::ErrorDiagnostic::log(), llvm::DiagnosticPrinterRawOStream::operator<<(), and llvm::SourceMgr::PrintMessage().