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: |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame^] | 27 | TextDiagnosticPrinter() {} |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 28 | |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame^] | 29 | void PrintIncludeStack(SourceLocation Pos, SourceManager& SrcMgr); |
| 30 | void HighlightRange(const SourceRange &R, |
| 31 | SourceManager& SrcMgr, |
| 32 | unsigned LineNo, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 33 | std::string &CaratLine, |
| 34 | const std::string &SourceLine); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 35 | |
Chris Lattner | 0750618 | 2007-11-30 22:53:43 +0000 | [diff] [blame] | 36 | virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 37 | SourceLocation Pos, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame^] | 38 | diag::kind ID, |
| 39 | SourceManager& SrcMgr, |
| 40 | const std::string *Strs, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 41 | unsigned NumStrs, |
| 42 | const SourceRange *Ranges, |
| 43 | unsigned NumRanges); |
| 44 | }; |
| 45 | |
| 46 | } // end namspace clang |
| 47 | |
| 48 | #endif |