Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- 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 | |
| 21 | namespace clang { |
| 22 | class SourceManager; |
| 23 | |
| 24 | class TextDiagnosticPrinter : public TextDiagnostics { |
| 25 | SourceLocation LastWarningLoc; |
| 26 | public: |
| 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 Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 34 | |
Chris Lattner | 0750618 | 2007-11-30 22:53:43 +0000 | [diff] [blame^] | 35 | virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 36 | 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 |