#ifndef CXX_DIAGNOSTIC_CONSUMER #define CXX_DIAGNOSTIC_CONSUMER #include "clang/Frontend/TextDiagnosticPrinter.h" class CanonicalFilePathCache; class FileRegister; class ParserClient; class CxxDiagnosticConsumer : public clang::TextDiagnosticPrinter { public: CxxDiagnosticConsumer( clang::raw_ostream &os, clang::DiagnosticOptions *diags, std::shared_ptr client, std::shared_ptr fileRegister, std::shared_ptr canonicalFilePathCache, bool useLogging = true ); void BeginSourceFile(const clang::LangOptions& langOptions, const clang::Preprocessor* preProcessor); void EndSourceFile(); void HandleDiagnostic(clang::DiagnosticsEngine::Level level, const clang::Diagnostic& info); private: std::shared_ptr m_client; std::shared_ptr m_register; std::shared_ptr m_canonicalFilePathCache; bool m_isParsingFile; bool m_useLogging; }; #endif // CXX_DIAGNOSTIC_CONSUMER