Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- TextDiagnostics.h - Text Diagnostics Checkers ----------*- 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 the parent class for all text diagnostics. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef TEXT_DIAGNOSTICS_H_ |
| 15 | #define TEXT_DIAGNOSTICS_H_ |
| 16 | |
| 17 | #include "clang/Basic/Diagnostic.h" |
| 18 | |
| 19 | namespace clang { |
| 20 | class SourceManager; |
| 21 | class HeaderSearch; |
| 22 | class Preprocessor; |
| 23 | |
| 24 | class TextDiagnostics : public DiagnosticClient { |
| 25 | HeaderSearch *TheHeaderSearch; |
| 26 | protected: |
Chris Lattner | 0750618 | 2007-11-30 22:53:43 +0000 | [diff] [blame] | 27 | std::string FormatDiagnostic(Diagnostic &Diags, Diagnostic::Level Level, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 28 | diag::kind ID, |
| 29 | const std::string *Strs, |
| 30 | unsigned NumStrs); |
| 31 | public: |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 32 | TextDiagnostics() {} |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 33 | virtual ~TextDiagnostics(); |
| 34 | |
| 35 | void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; } |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 36 | |
Chris Lattner | 7097d91 | 2008-02-03 09:00:04 +0000 | [diff] [blame] | 37 | virtual bool isInSystemHeader(FullSourceLoc Pos) const; |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 0750618 | 2007-11-30 22:53:43 +0000 | [diff] [blame] | 39 | virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel, |
Ted Kremenek | 9c728dc | 2007-12-12 22:39:36 +0000 | [diff] [blame] | 40 | FullSourceLoc Pos, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 41 | diag::kind ID, |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 42 | const std::string *Strs, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 43 | unsigned NumStrs, |
| 44 | const SourceRange *Ranges, |
| 45 | unsigned NumRanges) = 0; |
| 46 | }; |
| 47 | |
| 48 | } // end namspace clang |
| 49 | |
| 50 | #endif |