blob: 2ab0066d034b3ca90193e2ddd6a7a5ac0c5c87f7 [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:
27 SourceManager &SourceMgr;
Reid Spencer5f016e22007-07-11 17:01:13 +000028
29 std::string FormatDiagnostic(Diagnostic::Level Level,
30 diag::kind ID,
31 const std::string *Strs,
32 unsigned NumStrs);
33public:
34 TextDiagnostics(SourceManager &sourceMgr) : SourceMgr(sourceMgr) {}
35 virtual ~TextDiagnostics();
36
37 void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; }
Reid Spencer5f016e22007-07-11 17:01:13 +000038
39 virtual bool IgnoreDiagnostic(Diagnostic::Level Level,
40 SourceLocation Pos);
41 virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
42 SourceLocation Pos,
43 diag::kind ID, const std::string *Strs,
44 unsigned NumStrs,
45 const SourceRange *Ranges,
46 unsigned NumRanges) = 0;
47};
48
49} // end namspace clang
50
51#endif