17 #include "llvm/ADT/SmallString.h" 18 #include "llvm/Support/ErrorHandling.h" 20 using namespace clang;
32 default: llvm_unreachable(
33 "Diagnostic not handled during diagnostic buffering!");
35 All.emplace_back(Level, Notes.size());
39 All.emplace_back(Level, Warnings.size());
40 Warnings.emplace_back(Info.
getLocation(), Buf.str());
43 All.emplace_back(Level, Remarks.size());
44 Remarks.emplace_back(Info.
getLocation(), Buf.str());
48 All.emplace_back(Level, Errors.size());
55 for (
const auto &I : All) {
58 default: llvm_unreachable(
59 "Diagnostic not handled during diagnostic flushing!");
61 Diag << Notes[I.second].second;
64 Diag << Warnings[I.second].second;
67 Diag << Remarks[I.second].second;
71 Diag << Errors[I.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
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Concrete class used by the front-end to report problems and issues.
Defines the Diagnostic-related interfaces.
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...