blob: 441f5ed80b74f6ddbac4d2e884e47a36fee91efb [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Reid Spencer5f016e22007-07-11 17:01:13 +00007//
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,
Chris Lattnere41b7cd2008-01-12 06:43:35 +000033 unsigned LineNo, unsigned FileID,
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