blob: beb9d808e9927ecf532ace7c9d38fe3a81a0c7d6 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Bill Wendling and is distributed under the
6// University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is a concrete diagnostic client, which prints the diagnostics to
11// standard error.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
16#define TEXT_DIAGNOSTIC_PRINTER_H_
17
18#include "TextDiagnostics.h"
19#include "clang/Basic/SourceLocation.h"
20
21namespace clang {
22class SourceManager;
23
24class TextDiagnosticPrinter : public TextDiagnostics {
25 SourceLocation LastWarningLoc;
26public:
27 TextDiagnosticPrinter(SourceManager &sourceMgr)
28 : TextDiagnostics(sourceMgr) {}
29
30 void PrintIncludeStack(SourceLocation Pos);
31 void HighlightRange(const SourceRange &R, unsigned LineNo,
32 std::string &CaratLine,
33 const std::string &SourceLine);
Reid Spencer5f016e22007-07-11 17:01:13 +000034
Chris Lattner07506182007-11-30 22:53:43 +000035 virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel,
Reid Spencer5f016e22007-07-11 17:01:13 +000036 SourceLocation Pos,
37 diag::kind ID, const std::string *Strs,
38 unsigned NumStrs,
39 const SourceRange *Ranges,
40 unsigned NumRanges);
41};
42
43} // end namspace clang
44
45#endif