blob: 4149c65acf6457bdabdcaa5223219d21f69e1355 [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 {
Ted Kremenek9c728dc2007-12-12 22:39:36 +000025 FullSourceLoc LastWarningLoc;
Reid Spencer5f016e22007-07-11 17:01:13 +000026public:
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000027 TextDiagnosticPrinter() {}
Reid Spencer5f016e22007-07-11 17:01:13 +000028
Ted Kremenek9c728dc2007-12-12 22:39:36 +000029 void PrintIncludeStack(FullSourceLoc Pos);
30
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000031 void HighlightRange(const SourceRange &R,
Ted Kremenek9c728dc2007-12-12 22:39:36 +000032 SourceManager& SrcMgr,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000033 unsigned LineNo,
Reid Spencer5f016e22007-07-11 17:01:13 +000034 std::string &CaratLine,
35 const std::string &SourceLine);
Reid Spencer5f016e22007-07-11 17:01:13 +000036
Ted Kremenek9c728dc2007-12-12 22:39:36 +000037 virtual void HandleDiagnostic(Diagnostic &Diags,
38 Diagnostic::Level DiagLevel,
39 FullSourceLoc Pos,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000040 diag::kind ID,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000041 const std::string *Strs,
Reid Spencer5f016e22007-07-11 17:01:13 +000042 unsigned NumStrs,
43 const SourceRange *Ranges,
44 unsigned NumRanges);
45};
46
47} // end namspace clang
48
49#endif