clang
10.0.0git
|
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) that allows clients to enquire about the currently in-flight diagnostic. More...
#include "clang/Basic/Diagnostic.h"
Public Member Functions | |
Diagnostic (const DiagnosticsEngine *DO) | |
Diagnostic (const DiagnosticsEngine *DO, StringRef storedDiagMessage) | |
const DiagnosticsEngine * | getDiags () const |
unsigned | getID () const |
const SourceLocation & | getLocation () const |
bool | hasSourceManager () const |
SourceManager & | getSourceManager () const |
unsigned | getNumArgs () const |
DiagnosticsEngine::ArgumentKind | getArgKind (unsigned Idx) const |
Return the kind of the specified index. More... | |
const std::string & | getArgStdStr (unsigned Idx) const |
Return the provided argument string specified by Idx . More... | |
const char * | getArgCStr (unsigned Idx) const |
Return the specified C string argument. More... | |
int | getArgSInt (unsigned Idx) const |
Return the specified signed integer argument. More... | |
unsigned | getArgUInt (unsigned Idx) const |
Return the specified unsigned integer argument. More... | |
const IdentifierInfo * | getArgIdentifier (unsigned Idx) const |
Return the specified IdentifierInfo argument. More... | |
intptr_t | getRawArg (unsigned Idx) const |
Return the specified non-string argument in an opaque form. More... | |
unsigned | getNumRanges () const |
Return the number of source ranges associated with this diagnostic. More... | |
const CharSourceRange & | getRange (unsigned Idx) const |
ArrayRef< CharSourceRange > | getRanges () const |
Return an array reference for this diagnostic's ranges. More... | |
unsigned | getNumFixItHints () const |
const FixItHint & | getFixItHint (unsigned Idx) const |
ArrayRef< FixItHint > | getFixItHints () const |
void | FormatDiagnostic (SmallVectorImpl< char > &OutStr) const |
Format this diagnostic into a string, substituting the formal arguments into the %0 slots. More... | |
void | FormatDiagnostic (const char *DiagStr, const char *DiagEnd, SmallVectorImpl< char > &OutStr) const |
Format the given format-string into the output buffer using the arguments stored in this diagnostic. More... | |
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) that allows clients to enquire about the currently in-flight diagnostic.
Definition at line 1327 of file Diagnostic.h.
|
inlineexplicit |
Definition at line 1332 of file Diagnostic.h.
|
inline |
Definition at line 1333 of file Diagnostic.h.
void Diagnostic::FormatDiagnostic | ( | SmallVectorImpl< char > & | OutStr | ) | const |
Format this diagnostic into a string, substituting the formal arguments into the %0 slots.
FormatDiagnostic - Format this diagnostic into a string, substituting the formal arguments into the %0 slots.
The result is appended onto the OutStr
array.
The result is appended onto the Str array.
Definition at line 763 of file Diagnostic.cpp.
References Diag().
Referenced by AddRangeLocationAbbrev(), clang::PartialDiagnostic::EmitToString(), getTokenDescForDiagnostic(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::TextDiagnosticBuffer::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), HandlePluralModifier(), HandleSelectModifier(), and clang::StoredDiagnostic::StoredDiagnostic().
void Diagnostic::FormatDiagnostic | ( | const char * | DiagStr, |
const char * | DiagEnd, | ||
SmallVectorImpl< char > & | OutStr | ||
) | const |
Format the given format-string into the output buffer using the arguments stored in this diagnostic.
FormattedArgs - Keep track of all of the arguments formatted by ConvertArgToString and pass them into subsequent calls to ConvertArgToString, allowing the implementation to avoid redundancies in obvious cases.
QualTypeVals - Pass a vector of arrays so that QualType names can be compared to see if more information is needed to be printed.
Definition at line 776 of file Diagnostic.cpp.
References clang::DiagnosticsEngine::ak_std_string, and clang::threadSafety::sx::equals().
|
inline |
Return the specified C string argument.
Definition at line 1365 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_c_string.
|
inline |
Return the specified IdentifierInfo argument.
Definition at line 1389 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_identifierinfo.
|
inline |
Return the kind of the specified index.
Based on the kind of argument, the accessors below can be used to get the value.
Definition at line 1350 of file Diagnostic.h.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return the specified signed integer argument.
Definition at line 1373 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_sint.
|
inline |
Return the provided argument string specified by Idx
.
Definition at line 1357 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return the specified unsigned integer argument.
Definition at line 1381 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_uint.
|
inline |
Definition at line 1336 of file Diagnostic.h.
Referenced by printDiagnosticOptions().
|
inline |
Definition at line 1423 of file Diagnostic.h.
Referenced by clang::FixItRewriter::HandleDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
Definition at line 1428 of file Diagnostic.h.
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1337 of file Diagnostic.h.
Referenced by clang::DiagnosticsEngine::EmitCurrentDiagnostic(), clang::DiagnosticIDs::getNearestOption(), getStableLevel(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::arcmt::CapturedDiagList::hasErrors(), and printDiagnosticOptions().
|
inline |
Definition at line 1338 of file Diagnostic.h.
Referenced by AddRangeLocationAbbrev(), clang::DiagnosticsEngine::EmitCurrentDiagnostic(), clang::Sema::EmitCurrentDiagnostic(), clang::DiagnosticIDs::getNearestOption(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::TextDiagnosticBuffer::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::FixItRewriter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), clang::arcmt::CapturedDiagList::hasErrors(), isInMainFile(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1342 of file Diagnostic.h.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1419 of file Diagnostic.h.
Referenced by clang::FixItRewriter::HandleDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return the number of source ranges associated with this diagnostic.
Definition at line 1404 of file Diagnostic.h.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1409 of file Diagnostic.h.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return an array reference for this diagnostic's ranges.
Definition at line 1415 of file Diagnostic.h.
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Return the specified non-string argument in an opaque form.
Definition at line 1397 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string.
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1340 of file Diagnostic.h.
References clang::DiagnosticsEngine::getSourceManager().
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), isInMainFile(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1339 of file Diagnostic.h.
References clang::DiagnosticsEngine::hasSourceManager().
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), isInMainFile(), and clang::StoredDiagnostic::StoredDiagnostic().