blob: 7741ab99b86e7bbef1204815ebb67def67861bfb [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TextDiagnostics.h - Text Diagnostics Checkers ----------*- 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 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
19namespace clang {
20class SourceManager;
21class HeaderSearch;
22class Preprocessor;
23
24class TextDiagnostics : public DiagnosticClient {
25 HeaderSearch *TheHeaderSearch;
26protected:
Chris Lattner07506182007-11-30 22:53:43 +000027 std::string FormatDiagnostic(Diagnostic &Diags, Diagnostic::Level Level,
Reid Spencer5f016e22007-07-11 17:01:13 +000028 diag::kind ID,
29 const std::string *Strs,
30 unsigned NumStrs);
31public:
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000032 TextDiagnostics() {}
Reid Spencer5f016e22007-07-11 17:01:13 +000033 virtual ~TextDiagnostics();
34
35 void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; }
Reid Spencer5f016e22007-07-11 17:01:13 +000036
37 virtual bool IgnoreDiagnostic(Diagnostic::Level Level,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000038 SourceLocation Pos,
Ted Kremenek2eefd862007-12-11 22:57:35 +000039 SourceManager* SrcMgr);
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000040
Chris Lattner07506182007-11-30 22:53:43 +000041 virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel,
Reid Spencer5f016e22007-07-11 17:01:13 +000042 SourceLocation Pos,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000043 diag::kind ID,
Ted Kremenek2eefd862007-12-11 22:57:35 +000044 SourceManager* SrcMgr,
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000045 const std::string *Strs,
Reid Spencer5f016e22007-07-11 17:01:13 +000046 unsigned NumStrs,
47 const SourceRange *Ranges,
48 unsigned NumRanges) = 0;
49};
50
51} // end namspace clang
52
53#endif