2007-06-07 17:34:54 +08:00
|
|
|
//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Bill Wendling and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This is a concrete diagnostic client, which prints the diagnostics to
|
|
|
|
// standard error.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2007-06-08 02:58:07 +08:00
|
|
|
#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
|
|
|
|
#define TEXT_DIAGNOSTIC_PRINTER_H_
|
2007-06-07 17:34:54 +08:00
|
|
|
|
2007-06-14 01:45:37 +08:00
|
|
|
#include "TextDiagnostics.h"
|
2007-06-07 17:34:54 +08:00
|
|
|
#include "clang/Basic/SourceLocation.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace clang {
|
|
|
|
class SourceManager;
|
|
|
|
|
2007-06-14 01:45:37 +08:00
|
|
|
class TextDiagnosticPrinter : public TextDiagnostics {
|
2007-06-07 17:34:54 +08:00
|
|
|
SourceLocation LastWarningLoc;
|
|
|
|
public:
|
|
|
|
TextDiagnosticPrinter(SourceManager &sourceMgr)
|
2007-06-14 01:45:37 +08:00
|
|
|
: TextDiagnostics(sourceMgr) {}
|
2007-06-07 17:34:54 +08:00
|
|
|
|
|
|
|
void PrintIncludeStack(SourceLocation Pos);
|
|
|
|
void HighlightRange(const SourceRange &R, unsigned LineNo,
|
|
|
|
std::string &CaratLine,
|
|
|
|
const std::string &SourceLine);
|
|
|
|
unsigned GetTokenLength(SourceLocation Loc);
|
|
|
|
|
|
|
|
virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
|
|
|
|
SourceLocation Pos,
|
|
|
|
diag::kind ID, const std::string *Strs,
|
|
|
|
unsigned NumStrs,
|
|
|
|
const SourceRange *Ranges,
|
|
|
|
unsigned NumRanges);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namspace clang
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|