15 #include "llvm/ADT/SmallString.h" 16 #include "llvm/Support/ErrorHandling.h" 17 using namespace clang;
30 default: llvm_unreachable(
31 "Diagnostic not handled during diagnostic buffering!");
33 All.emplace_back(Level, Notes.size());
37 All.emplace_back(Level, Warnings.size());
38 Warnings.emplace_back(Info.
getLocation(), Buf.str());
41 All.emplace_back(Level, Remarks.size());
42 Remarks.emplace_back(Info.
getLocation(), Buf.str());
46 All.emplace_back(Level, Errors.size());
53 for (
auto it = All.begin(), ie = All.end(); it != ie; ++it) {
56 default: llvm_unreachable(
57 "Diagnostic not handled during diagnostic flushing!");
59 Diag << Notes[it->second].second;
62 Diag << Warnings[it->second].second;
65 Diag << Remarks[it->second].second;
69 Diag << Errors[it->second].second;
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
HandleDiagnostic - Store the errors, warnings, and notes that are reported.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
const SourceLocation & getLocation() const
Concrete class used by the front-end to report problems and issues.
virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info)
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
Dataflow Directional Tag Classes.
Level
The level of the diagnostic, after it has been through mapping.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
void FlushDiagnostics(DiagnosticsEngine &Diags) const
FlushDiagnostics - Flush the buffered diagnostics to an given diagnostic engine.
void FormatDiagnostic(SmallVectorImpl< char > &OutStr) const
Format this diagnostic into a string, substituting the formal arguments into the %0 slots...