Deleted Added
sdiff udiff text old ( 207632 ) new ( 208600 )
full compact
1//===--- TextDiagnosticPrinter.cpp - Diagnostic Printer -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 4 unchanged lines hidden (view full) ---

13
14#include "clang/Frontend/TextDiagnosticPrinter.h"
15#include "clang/Basic/SourceManager.h"
16#include "clang/Frontend/DiagnosticOptions.h"
17#include "clang/Lex/Lexer.h"
18#include "llvm/Support/MemoryBuffer.h"
19#include "llvm/Support/raw_ostream.h"
20#include "llvm/ADT/SmallString.h"
21#include <algorithm>
22using namespace clang;
23
24static const enum llvm::raw_ostream::Colors noteColor =
25 llvm::raw_ostream::BLACK;
26static const enum llvm::raw_ostream::Colors fixitColor =
27 llvm::raw_ostream::GREEN;
28static const enum llvm::raw_ostream::Colors caretColor =

--- 785 unchanged lines hidden (view full) ---

814 }
815
816 if (DiagOpts->ShowColors)
817 OS.resetColor();
818
819 llvm::SmallString<100> OutStr;
820 Info.FormatDiagnostic(OutStr);
821
822 if (DiagOpts->ShowOptionNames) {
823 if (const char *Opt = Diagnostic::getWarningOptionForDiag(Info.getID())) {
824 OutStr += " [-W";
825 OutStr += Opt;
826 OutStr += ']';
827 } else {
828 // If the diagnostic is an extension diagnostic and not enabled by default
829 // then it must have been turned on with -pedantic.
830 bool EnabledByDefault;
831 if (Diagnostic::isBuiltinExtensionDiag(Info.getID(), EnabledByDefault) &&
832 !EnabledByDefault)
833 OutStr += " [-pedantic]";
834 }
835 }
836
837 if (DiagOpts->ShowColors) {
838 // Print warnings, errors and fatal errors in bold, no color
839 switch (Level) {
840 case Diagnostic::Warning: OS.changeColor(savedColor, true); break;
841 case Diagnostic::Error: OS.changeColor(savedColor, true); break;
842 case Diagnostic::Fatal: OS.changeColor(savedColor, true); break;
843 default: break; //don't bold notes
844 }

--- 72 unchanged lines hidden ---