clang
7.0.0
|
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 1315 of file Diagnostic.h.
|
inlineexplicit |
Definition at line 1320 of file Diagnostic.h.
|
inline |
Definition at line 1321 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 756 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 769 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 1353 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_c_string.
|
inline |
Return the specified IdentifierInfo argument.
Definition at line 1377 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 1338 of file Diagnostic.h.
|
inline |
Return the specified signed integer argument.
Definition at line 1361 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_sint.
|
inline |
Return the provided argument string specified by Idx
.
Definition at line 1345 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string.
|
inline |
Return the specified unsigned integer argument.
Definition at line 1369 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_uint.
|
inline |
Definition at line 1324 of file Diagnostic.h.
Referenced by printDiagnosticOptions().
|
inline |
Definition at line 1411 of file Diagnostic.h.
Referenced by clang::FixItRewriter::HandleDiagnostic().
Definition at line 1416 of file Diagnostic.h.
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1325 of file Diagnostic.h.
Referenced by clang::DiagnosticsEngine::EmitCurrentDiagnostic(), clang::DiagnosticIDs::getNearestOption(), getStableLevel(), clang::LogDiagnosticPrinter::HandleDiagnostic(), and printDiagnosticOptions().
|
inline |
Definition at line 1326 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(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1330 of file Diagnostic.h.
|
inline |
Definition at line 1407 of file Diagnostic.h.
Referenced by clang::FixItRewriter::HandleDiagnostic().
|
inline |
Return the number of source ranges associated with this diagnostic.
Definition at line 1392 of file Diagnostic.h.
|
inline |
Definition at line 1397 of file Diagnostic.h.
|
inline |
Return an array reference for this diagnostic's ranges.
Definition at line 1403 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 1385 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string.
|
inline |
Definition at line 1328 of file Diagnostic.h.
References clang::DiagnosticsEngine::getSourceManager().
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1327 of file Diagnostic.h.
References clang::DiagnosticsEngine::hasSourceManager().
Referenced by AddRangeLocationAbbrev(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().