blob: c87c20e4f0006ad09dd2afbffa3fd24e8e54a044 [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:
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000027 TextDiagnosticPrinter() {}
Reid Spencer5f016e22007-07-11 17:01:13 +000028
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000029 void PrintIncludeStack(SourceLocation Pos, SourceManager& SrcMgr);
30 void HighlightRange(const SourceRange &R,
31 SourceManager& SrcMgr,
32 unsigned LineNo,
Reid Spencer5f016e22007-07-11 17:01:13 +000033 std::string &CaratLine,
34 const std::string &SourceLine);
Reid Spencer5f016e22007-07-11 17:01:13 +000035
Chris Lattner07506182007-11-30 22:53:43 +000036 virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel,
Reid Spencer5f016e22007-07-11 17:01:13 +000037 SourceLocation Pos,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000038 diag::kind ID,
39 SourceManager& SrcMgr,
40 const std::string *Strs,
Reid Spencer5f016e22007-07-11 17:01:13 +000041 unsigned NumStrs,
42 const SourceRange *Ranges,
43 unsigned NumRanges);
44};
45
46} // end namspace clang
47
48#endif