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 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 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 { |
Ted Kremenek | 9c728dc | 2007-12-12 22:39:36 +0000 | [diff] [blame] | 25 | FullSourceLoc LastWarningLoc; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 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 | 9c728dc | 2007-12-12 22:39:36 +0000 | [diff] [blame] | 29 | void PrintIncludeStack(FullSourceLoc Pos); |
| 30 | |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 31 | void HighlightRange(const SourceRange &R, |
Ted Kremenek | 9c728dc | 2007-12-12 22:39:36 +0000 | [diff] [blame] | 32 | SourceManager& SrcMgr, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 33 | unsigned LineNo, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 34 | std::string &CaratLine, |
| 35 | const std::string &SourceLine); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 36 | |
Ted Kremenek | 9c728dc | 2007-12-12 22:39:36 +0000 | [diff] [blame] | 37 | virtual void HandleDiagnostic(Diagnostic &Diags, |
| 38 | Diagnostic::Level DiagLevel, |
| 39 | FullSourceLoc Pos, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 40 | diag::kind ID, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 41 | const std::string *Strs, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 42 | unsigned NumStrs, |
| 43 | const SourceRange *Ranges, |
| 44 | unsigned NumRanges); |
| 45 | }; |
| 46 | |
| 47 | } // end namspace clang |
| 48 | |
| 49 | #endif |