LLVM: llvm::SMDiagnostic Class Reference (original) (raw)

Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic. More...

#include "[llvm/Support/SourceMgr.h](Support%5F2SourceMgr%5F8h%5Fsource.html)"

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.

llvm::SMDiagnostic::SMDiagnostic ( ) default

SMDiagnostic() [2/3]

SMDiagnostic() [3/3]

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 = {} )

addFixIt()

void llvm::SMDiagnostic::addFixIt ( const SMFixIt & Hint) inline

getColumnNo()

int llvm::SMDiagnostic::getColumnNo ( ) const inline

getFilename()

StringRef llvm::SMDiagnostic::getFilename ( ) const inline

getFixIts()

getKind()

getLineContents()

StringRef llvm::SMDiagnostic::getLineContents ( ) const inline

getLineNo()

int llvm::SMDiagnostic::getLineNo ( ) const inline

getLoc()

SMLoc llvm::SMDiagnostic::getLoc ( ) const inline

getMessage()

StringRef llvm::SMDiagnostic::getMessage ( ) const inline

getRanges()

getSourceMgr()

print()

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().


The documentation for this class was generated from the following files: