diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /include/clang/Frontend/TextDiagnosticPrinter.h | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'include/clang/Frontend/TextDiagnosticPrinter.h')
-rw-r--r-- | include/clang/Frontend/TextDiagnosticPrinter.h | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h index 22fa18b..9b6ac24 100644 --- a/include/clang/Frontend/TextDiagnosticPrinter.h +++ b/include/clang/Frontend/TextDiagnosticPrinter.h @@ -16,25 +16,28 @@ #define LLVM_CLANG_FRONTEND_TEXT_DIAGNOSTIC_PRINTER_H_ #include "clang/Basic/Diagnostic.h" -#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/LLVM.h" +#include "llvm/ADT/OwningPtr.h" namespace clang { class DiagnosticOptions; class LangOptions; +class TextDiagnostic; class TextDiagnosticPrinter : public DiagnosticConsumer { raw_ostream &OS; const LangOptions *LangOpts; const DiagnosticOptions *DiagOpts; + const SourceManager *SM; - SourceLocation LastWarningLoc; - FullSourceLoc LastLoc; - unsigned LastCaretDiagnosticWasNote : 1; - unsigned OwnsOutputStream : 1; + /// \brief Handle to the currently active text diagnostic emitter. + OwningPtr<TextDiagnostic> TextDiag; /// A string to prefix to error messages. std::string Prefix; + unsigned OwnsOutputStream : 1; + public: TextDiagnosticPrinter(raw_ostream &os, const DiagnosticOptions &diags, bool OwnsOutputStream = false); @@ -45,27 +48,10 @@ public: /// used. void setPrefix(std::string Value) { Prefix = Value; } - void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) { - LangOpts = &LO; - } - - void EndSourceFile() { - LangOpts = 0; - } - - void PrintIncludeStack(DiagnosticsEngine::Level Level, SourceLocation Loc, - const SourceManager &SM); - - virtual void HandleDiagnostic(DiagnosticsEngine::Level Level, - const Diagnostic &Info); - + void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP); + void EndSourceFile(); + void HandleDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info); DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const; - -private: - void EmitDiagnosticLoc(DiagnosticsEngine::Level Level, - const Diagnostic &Info, - const SourceManager &SM, - PresumedLoc PLoc); }; } // end namespace clang |