2007-06-14 01:45:37 +08:00
|
|
|
//===--- TextDiagnostics.h - Text Diagnostics Checkers ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 03:59:25 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-14 01:45:37 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This is the parent class for all text diagnostics.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef TEXT_DIAGNOSTICS_H_
|
|
|
|
#define TEXT_DIAGNOSTICS_H_
|
|
|
|
|
|
|
|
#include "clang/Basic/Diagnostic.h"
|
|
|
|
|
2007-06-16 07:05:46 +08:00
|
|
|
namespace clang {
|
|
|
|
class SourceManager;
|
|
|
|
class HeaderSearch;
|
|
|
|
class Preprocessor;
|
|
|
|
|
|
|
|
class TextDiagnostics : public DiagnosticClient {
|
|
|
|
HeaderSearch *TheHeaderSearch;
|
|
|
|
protected:
|
2007-12-01 06:53:43 +08:00
|
|
|
std::string FormatDiagnostic(Diagnostic &Diags, Diagnostic::Level Level,
|
2007-06-16 07:05:46 +08:00
|
|
|
diag::kind ID,
|
|
|
|
const std::string *Strs,
|
|
|
|
unsigned NumStrs);
|
|
|
|
public:
|
2007-12-12 05:27:55 +08:00
|
|
|
TextDiagnostics() {}
|
2007-06-16 07:05:46 +08:00
|
|
|
virtual ~TextDiagnostics();
|
|
|
|
|
|
|
|
void setHeaderSearch(HeaderSearch &HS) { TheHeaderSearch = &HS; }
|
|
|
|
|
2008-02-03 17:00:04 +08:00
|
|
|
virtual bool isInSystemHeader(FullSourceLoc Pos) const;
|
2007-12-12 05:27:55 +08:00
|
|
|
|
2007-12-01 06:53:43 +08:00
|
|
|
virtual void HandleDiagnostic(Diagnostic &Diags, Diagnostic::Level DiagLevel,
|
2007-12-13 06:39:36 +08:00
|
|
|
FullSourceLoc Pos,
|
2007-12-12 05:27:55 +08:00
|
|
|
diag::kind ID,
|
|
|
|
const std::string *Strs,
|
2007-06-16 07:05:46 +08:00
|
|
|
unsigned NumStrs,
|
|
|
|
const SourceRange *Ranges,
|
|
|
|
unsigned NumRanges) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namspace clang
|
2007-06-14 01:45:37 +08:00
|
|
|
|
|
|
|
#endif
|