LLVM API Documentation
#include <SourceMgr.h>
Public Member Functions | |
SMDiagnostic () | |
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) const |
SMDiagnostic - Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic.
Definition at line 212 of file SourceMgr.h.
|
inline |
Definition at line 224 of file SourceMgr.h.
|
inline |
Definition at line 227 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 = None |
||
) |
Definition at line 245 of file SourceMgr.cpp.
|
inline |
Definition at line 250 of file SourceMgr.h.
|
inline |
Definition at line 242 of file SourceMgr.h.
|
inline |
Definition at line 240 of file SourceMgr.h.
Definition at line 254 of file SourceMgr.h.
|
inline |
Definition at line 243 of file SourceMgr.h.
|
inline |
Definition at line 245 of file SourceMgr.h.
|
inline |
Definition at line 241 of file SourceMgr.h.
Referenced by srcMgrDiagHandler().
|
inline |
Definition at line 239 of file SourceMgr.h.
|
inline |
Definition at line 244 of file SourceMgr.h.
Definition at line 246 of file SourceMgr.h.
|
inline |
Definition at line 238 of file SourceMgr.h.
void SMDiagnostic::print | ( | const char * | ProgName, |
raw_ostream & | S, | ||
bool | ShowColors = true |
||
) | const |
Definition at line 348 of file SourceMgr.cpp.
References llvm::raw_ostream::BLACK, buildFixItLine(), llvm::raw_ostream::changeColor(), llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::SourceMgr::DK_Warning, llvm::SMLoc::getPointer(), llvm::raw_ostream::GREEN, llvm::raw_ostream::has_colors(), isNonASCII(), llvm::raw_ostream::MAGENTA, llvm::makeArrayRef(), printSourceLine(), llvm::raw_ostream::RED, llvm::raw_ostream::resetColor(), llvm::raw_ostream::SAVEDCOLOR, and TabStop.
Referenced by LLVMParseIRInContext(), and llvm::SourceMgr::PrintMessage().