clang
3.7.0
|
#include <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 1138 of file Diagnostic.h.
|
inlineexplicit |
Definition at line 1142 of file Diagnostic.h.
|
inline |
Definition at line 1143 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.
The result is appended onto the OutStr
array.
FormatDiagnostic - Format this diagnostic into a string, substituting the formal arguments into the %0 slots. The result is appended onto the Str array.
Definition at line 630 of file Diagnostic.cpp.
References Diag(), clang::DiagnosticsEngine::getDiagnosticIDs(), getDiags(), and getID().
Referenced by clang::PartialDiagnostic::EmitToString(), FormatDiagnostic(), clang::TextDiagnosticBuffer::HandleDiagnostic(), clang::TextDiagnosticPrinter::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 643 of file Diagnostic.cpp.
References clang::DiagnosticsEngine::ak_attr, clang::DiagnosticsEngine::ak_c_string, clang::DiagnosticsEngine::ak_declarationname, clang::DiagnosticsEngine::ak_declcontext, clang::DiagnosticsEngine::ak_nameddecl, clang::DiagnosticsEngine::ak_nestednamespec, clang::DiagnosticsEngine::ak_qualtype, clang::DiagnosticsEngine::ak_qualtype_pair, clang::DiagnosticsEngine::ak_sint, clang::DiagnosticsEngine::ak_std_string, clang::DiagnosticsEngine::ak_tokenkind, clang::DiagnosticsEngine::ak_uint, clang::DiagnosticsEngine::ConvertArgToString(), clang::TemplateDiffTypes::ElideType, clang::threadSafety::sx::equals(), FormatDiagnostic(), clang::TemplateDiffTypes::FromType, getArgCStr(), getArgKind(), getArgSInt(), getArgStdStr(), getArgUInt(), getDiags(), clang::tok::getKeywordSpelling(), getNumArgs(), clang::tok::getPunctuatorSpelling(), getRawArg(), getTokenDescForDiagnostic(), clang::tok::getTokenName(), HandleIntegerSModifier(), HandleOrdinalModifier(), HandlePluralModifier(), HandleSelectModifier(), clang::isDigit(), clang::isPunctuation(), ModifierIs(), clang::TemplateDiffTypes::PrintFromType, clang::TemplateDiffTypes::PrintTree, S, ScanFormat(), clang::TemplateDiffTypes::ShowColors, clang::TemplateDiffTypes::TemplateDiffUsed, and clang::TemplateDiffTypes::ToType.
|
inline |
Return the specified C string argument.
Definition at line 1175 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_c_string, and getArgKind().
Referenced by FormatDiagnostic().
|
inline |
Return the specified IdentifierInfo argument.
Definition at line 1199 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_identifierinfo, and getArgKind().
|
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 1160 of file Diagnostic.h.
References getNumArgs().
Referenced by FormatDiagnostic(), getArgCStr(), getArgIdentifier(), getArgSInt(), getArgStdStr(), getArgUInt(), getRawArg(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return the specified signed integer argument.
Definition at line 1183 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_sint, and getArgKind().
Referenced by FormatDiagnostic().
|
inline |
Return the provided argument string specified by Idx
.
Definition at line 1167 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string, and getArgKind().
Referenced by FormatDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
Return the specified unsigned integer argument.
Definition at line 1191 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_uint, and getArgKind().
Referenced by FormatDiagnostic().
|
inline |
Definition at line 1146 of file Diagnostic.h.
Referenced by FormatDiagnostic(), and printDiagnosticOptions().
Definition at line 1233 of file Diagnostic.h.
References getNumFixItHints().
Referenced by clang::FixItRewriter::HandleDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
Definition at line 1238 of file Diagnostic.h.
Referenced by clang::TextDiagnosticPrinter::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1147 of file Diagnostic.h.
Referenced by clang::DiagnosticsEngine::EmitCurrentDiagnostic(), FormatDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), and printDiagnosticOptions().
|
inline |
Definition at line 1148 of file Diagnostic.h.
Referenced by clang::DiagnosticsEngine::EmitCurrentDiagnostic(), clang::Sema::EmitCurrentDiagnostic(), clang::TextDiagnosticBuffer::HandleDiagnostic(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::FixItRewriter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1152 of file Diagnostic.h.
Referenced by FormatDiagnostic(), getArgKind(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1229 of file Diagnostic.h.
Referenced by getFixItHint(), clang::FixItRewriter::HandleDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return the number of source ranges associated with this diagnostic.
Definition at line 1214 of file Diagnostic.h.
Referenced by getRange(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1219 of file Diagnostic.h.
References getNumRanges().
Referenced by clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Return an array reference for this diagnostic's ranges.
Definition at line 1225 of file Diagnostic.h.
Referenced by clang::TextDiagnosticPrinter::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Return the specified non-string argument in an opaque form.
Definition at line 1207 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string, and getArgKind().
Referenced by FormatDiagnostic(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1150 of file Diagnostic.h.
References clang::DiagnosticsEngine::getSourceManager().
Referenced by clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().
|
inline |
Definition at line 1149 of file Diagnostic.h.
References clang::DiagnosticsEngine::hasSourceManager().
Referenced by clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::VerifyDiagnosticConsumer::HandleDiagnostic(), and clang::StoredDiagnostic::StoredDiagnostic().