LLVM
8.0.1
|
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=None) | |
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) const |
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic.
Definition at line 260 of file SourceMgr.h.
|
default |
|
inline |
Definition at line 275 of file SourceMgr.h.
References llvm::None.
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 = None |
||
) |
Definition at line 265 of file SourceMgr.cpp.
References llvm::sort().
Definition at line 295 of file SourceMgr.h.
References llvm::SmallVectorTemplateBase< T >::push_back().
|
inline |
Definition at line 289 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence(), and llvm::MIRParserImpl::initializeJumpTableInfo().
|
inline |
Definition at line 287 of file SourceMgr.h.
Definition at line 299 of file SourceMgr.h.
References print().
Referenced by llvm::MIRParserImpl::initializeJumpTableInfo().
|
inline |
Definition at line 290 of file SourceMgr.h.
References Kind.
Referenced by llvm::MIRParserImpl::error(), getGNUBinOpPrecedence(), llvm::MIRParserImpl::initializeJumpTableInfo(), and llvm::MIRParserImpl::reportDiagnostic().
|
inline |
Definition at line 292 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence(), and llvm::MIRParserImpl::initializeJumpTableInfo().
|
inline |
Definition at line 288 of file SourceMgr.h.
Referenced by llvm::MIRParserImpl::initializeJumpTableInfo(), and srcMgrDiagHandler().
|
inline |
Definition at line 286 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence(), llvm::MIRParserImpl::initializeJumpTableInfo(), llvm::SourceMgr::PrintMessage(), and srcMgrDiagHandler().
|
inline |
Definition at line 291 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence(), and llvm::MIRParserImpl::initializeJumpTableInfo().
Definition at line 293 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence(), and llvm::MIRParserImpl::initializeJumpTableInfo().
Definition at line 285 of file SourceMgr.h.
Referenced by getGNUBinOpPrecedence().
void SMDiagnostic::print | ( | const char * | ProgName, |
raw_ostream & | S, | ||
bool | ShowColors = true , |
||
bool | ShowKindLabel = true |
||
) | const |
Definition at line 374 of file SourceMgr.cpp.
References buildFixItLine(), llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::SourceMgr::DK_Remark, llvm::SourceMgr::DK_Warning, llvm::WithColor::error(), llvm::find_if(), llvm::SMLoc::getPointer(), llvm::raw_ostream::GREEN, isNonASCII(), llvm::makeArrayRef(), llvm::WithColor::note(), printSourceLine(), llvm::WithColor::remark(), llvm::raw_ostream::SAVEDCOLOR, TabStop, and llvm::WithColor::warning().
Referenced by getGNUBinOpPrecedence(), LLVMParseIRInContext(), makeCombineInst(), llvm::DiagnosticPrinterRawOStream::operator<<(), and llvm::SourceMgr::PrintMessage().