18#include "llvm/Support/ErrorHandling.h" 
   19#include "llvm/Support/raw_ostream.h" 
   24                                             bool _OwnsOutputStream)
 
   25    : OS(os), DiagOpts(DiagOpts), OwnsOutputStream(_OwnsOutputStream) {}
 
 
   52  if (DiagOpts.ShowOptionNames) {
 
   54    if (Info.
getID() == diag::fatal_too_many_errors) {
 
   55      OS << 
" [-ferror-limit=]";
 
   81      OS << (Started ? 
"," : 
" [")
 
   84      if (!OptValue.empty())
 
   85        OS << 
"=" << OptValue;
 
   91  if (DiagOpts.ShowCategories) {
 
   92    unsigned DiagCategory =
 
   95      OS << (Started ? 
"," : 
" [");
 
   97      if (DiagOpts.ShowCategories == 1)
 
  100        assert(DiagOpts.ShowCategories == 2 && 
"Invalid ShowCategories value");
 
 
  119  llvm::raw_svector_ostream DiagMessageStream(OutStr);
 
  126  uint64_t StartOfLocationInfo = OS.tell();
 
  129    OS << Prefix << 
": ";
 
  139        DiagMessageStream.str(), OS.tell() - StartOfLocationInfo,
 
  140        DiagOpts.MessageLength, DiagOpts.ShowColors);
 
  147         "Unexpected diagnostic with no source manager");
 
  148  assert(TextDiag && 
"Unexpected diagnostic outside source file processing");
 
  150  TextDiag->emitDiagnostic(
 
 
Defines the SourceManager interface.
static void printDiagnosticOptions(raw_ostream &OS, DiagnosticsEngine::Level Level, const Diagnostic &Info, const DiagnosticOptions &DiagOpts)
Print any diagnostic option information to a raw_ostream.
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.
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
static unsigned getCategoryNumberForDiag(unsigned DiagID)
Return the category number that a specified DiagID belongs to, or 0 if no category.
Options for controlling the compiler diagnostics engine.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine a...
const SourceLocation & getLocation() const
void FormatDiagnostic(SmallVectorImpl< char > &OutStr) const
Format this diagnostic into a string, substituting the formal arguments into the %0 slots.
StringRef getFlagValue() const
Return the value associated with this diagnostic flag.
SourceManager & getSourceManager() const
ArrayRef< FixItHint > getFixItHints() const
bool hasSourceManager() const
ArrayRef< CharSourceRange > getRanges() const
Return an array reference for this diagnostic's ranges.
const DiagnosticsEngine * getDiags() const
Level
The level of the diagnostic, after it has been through mapping.
const IntrusiveRefCntPtr< DiagnosticIDs > & getDiagnosticIDs() const
A SourceLocation and its associated SourceManager.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
bool isValid() const
Return true if this is a valid SourceLocation object.
~TextDiagnosticPrinter() override
void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) override
Callback to inform the diagnostic client that processing of a source file is beginning.
void EndSourceFile() override
Callback to inform the diagnostic client that processing of a source file has ended.
TextDiagnosticPrinter(raw_ostream &os, DiagnosticOptions &DiagOpts, bool OwnsOutputStream=false)
void HandleDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info) override
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
Class to encapsulate the logic for formatting and printing a textual diagnostic message.
static void printDiagnosticMessage(raw_ostream &OS, bool IsSupplemental, StringRef Message, unsigned CurrentColumn, unsigned Columns, bool ShowColors)
Pretty-print a diagnostic message to a raw_ostream.
static void printDiagnosticLevel(raw_ostream &OS, DiagnosticsEngine::Level Level, bool ShowColors)
Print the diagonstic level to a raw_ostream.
The JSON file list parser is used to communicate input to InstallAPI.