Deleted Added
sdiff udiff text old ( 198092 ) new ( 199990 )
full compact
1//===--- TextDiagnosticBuffer.cpp - Buffer Text Diagnostics ---------------===//
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//===----------------------------------------------------------------------===//

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

15#include "llvm/ADT/SmallString.h"
16using namespace clang;
17
18/// HandleDiagnostic - Store the errors, warnings, and notes that are
19/// reported.
20///
21void TextDiagnosticBuffer::HandleDiagnostic(Diagnostic::Level Level,
22 const DiagnosticInfo &Info) {
23 llvm::SmallString<100> StrC;
24 Info.FormatDiagnostic(StrC);
25 std::string Str(StrC.begin(), StrC.end());
26 switch (Level) {
27 default: assert(0 && "Diagnostic not handled during diagnostic buffering!");
28 case Diagnostic::Note:
29 Notes.push_back(std::make_pair(Info.getLocation(), Str));
30 break;
31 case Diagnostic::Warning:
32 Warnings.push_back(std::make_pair(Info.getLocation(), Str));
33 break;
34 case Diagnostic::Error:
35 case Diagnostic::Fatal:
36 Errors.push_back(std::make_pair(Info.getLocation(), Str));
37 break;
38 }
39}