2007-06-07 17:34:54 +08:00
|
|
|
//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- 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-07 17:34:54 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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"
|
2008-04-18 02:06:57 +08:00
|
|
|
#include "llvm/Support/Streams.h"
|
2007-06-07 17:34:54 +08:00
|
|
|
|
2007-06-16 07:05:46 +08:00
|
|
|
namespace clang {
|
|
|
|
class SourceManager;
|
|
|
|
|
|
|
|
class TextDiagnosticPrinter : public TextDiagnostics {
|
2007-12-13 06:39:36 +08:00
|
|
|
FullSourceLoc LastWarningLoc;
|
2008-02-09 06:06:17 +08:00
|
|
|
FullSourceLoc LastLoc;
|
2008-04-18 02:06:57 +08:00
|
|
|
llvm::OStream OS;
|
2007-06-16 07:05:46 +08:00
|
|
|
public:
|
2008-04-18 02:06:57 +08:00
|
|
|
TextDiagnosticPrinter(llvm::OStream &os = llvm::cerr) : OS(os) {}
|
2007-06-16 07:05:46 +08:00
|
|
|
|
2007-12-13 06:39:36 +08:00
|
|
|
void PrintIncludeStack(FullSourceLoc Pos);
|
|
|
|
|
2007-12-12 05:27:55 +08:00
|
|
|
void HighlightRange(const SourceRange &R,
|
2007-12-13 06:39:36 +08:00
|
|
|
SourceManager& SrcMgr,
|
2008-01-12 14:43:35 +08:00
|
|
|
unsigned LineNo, unsigned FileID,
|
2007-06-16 07:05:46 +08:00
|
|
|
std::string &CaratLine,
|
|
|
|
const std::string &SourceLine);
|
|
|
|
|
2007-12-13 06:39:36 +08:00
|
|
|
virtual void HandleDiagnostic(Diagnostic &Diags,
|
|
|
|
Diagnostic::Level DiagLevel,
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namspace clang
|
2007-06-07 17:34:54 +08:00
|
|
|
|
|
|
|
#endif
|