llvm-capstone/clang/Driver/TextDiagnosticPrinter.h
Steve Naroff a369922449 A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well). 

llvm-svn: 46897
2008-02-08 22:06:17 +00:00

51 lines
1.6 KiB
C++

//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file 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.
//
//===----------------------------------------------------------------------===//
#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
#define TEXT_DIAGNOSTIC_PRINTER_H_
#include "TextDiagnostics.h"
#include "clang/Basic/SourceLocation.h"
namespace clang {
class SourceManager;
class TextDiagnosticPrinter : public TextDiagnostics {
FullSourceLoc LastWarningLoc;
FullSourceLoc LastLoc;
public:
TextDiagnosticPrinter() {}
void PrintIncludeStack(FullSourceLoc Pos);
void HighlightRange(const SourceRange &R,
SourceManager& SrcMgr,
unsigned LineNo, unsigned FileID,
std::string &CaratLine,
const std::string &SourceLine);
virtual void HandleDiagnostic(Diagnostic &Diags,
Diagnostic::Level DiagLevel,
FullSourceLoc Pos,
diag::kind ID,
const std::string *Strs,
unsigned NumStrs,
const SourceRange *Ranges,
unsigned NumRanges);
};
} // end namspace clang
#endif