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 |
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a caret diagnostic.
Definition at line 233 of file SourceMgr.h.
llvm::SMDiagnostic::SMDiagnostic | ( | ) | [inline] |
Definition at line 245 of file SourceMgr.h.
llvm::SMDiagnostic::SMDiagnostic | ( | StringRef | filename, |
SourceMgr::DiagKind | Knd, | ||
StringRef | Msg | ||
) | [inline] |
Definition at line 248 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 234 of file SourceMgr.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
void llvm::SMDiagnostic::addFixIt | ( | const SMFixIt & | Hint | ) | [inline] |
Definition at line 271 of file SourceMgr.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
int llvm::SMDiagnostic::getColumnNo | ( | ) | const [inline] |
Definition at line 263 of file SourceMgr.h.
StringRef llvm::SMDiagnostic::getFilename | ( | ) | const [inline] |
Definition at line 261 of file SourceMgr.h.
ArrayRef<SMFixIt> llvm::SMDiagnostic::getFixIts | ( | ) | const [inline] |
Definition at line 275 of file SourceMgr.h.
SourceMgr::DiagKind llvm::SMDiagnostic::getKind | ( | ) | const [inline] |
Definition at line 264 of file SourceMgr.h.
StringRef llvm::SMDiagnostic::getLineContents | ( | ) | const [inline] |
Definition at line 266 of file SourceMgr.h.
int llvm::SMDiagnostic::getLineNo | ( | ) | const [inline] |
Definition at line 262 of file SourceMgr.h.
Referenced by srcMgrDiagHandler().
SMLoc llvm::SMDiagnostic::getLoc | ( | ) | const [inline] |
Definition at line 260 of file SourceMgr.h.
Referenced by llvm::SourceMgr::PrintMessage().
StringRef llvm::SMDiagnostic::getMessage | ( | ) | const [inline] |
Definition at line 265 of file SourceMgr.h.
ArrayRef<std::pair<unsigned, unsigned> > llvm::SMDiagnostic::getRanges | ( | ) | const [inline] |
Definition at line 267 of file SourceMgr.h.
const SourceMgr* llvm::SMDiagnostic::getSourceMgr | ( | ) | const [inline] |
Definition at line 259 of file SourceMgr.h.
void SMDiagnostic::print | ( | const char * | ProgName, |
raw_ostream & | S, | ||
bool | ShowColors = true |
||
) | const |
Definition at line 337 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().