Logo ROOT  
Reference Guide
TClingDiagnostics.cxx
Go to the documentation of this file.
1// @(#)root/core/metacling:$Id$
2// Author: Javier Lopez-Gomez 16/07/2021
3
4/*************************************************************************
5 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TClingDiagnostics.h"
13
15(clang::DiagnosticOptions *DiagOpts, clang::LangOptions &LangOpts, handler_t fn)
16 : TextDiagnosticPrinter(fOS, DiagOpts), fOS(fOS_out), fHandler(fn)
17{
18 // Required to initialize the internal `clang::TextDiagnostic` instance.
19 TextDiagnosticPrinter::BeginSourceFile(LangOpts, nullptr);
20}
21
22void
23TClingDelegateDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level Level,
24 const clang::Diagnostic &Info)
25{
26 fOS_out.clear();
27 TextDiagnosticPrinter::HandleDiagnostic(Level, Info);
28 fHandler(Level, fOS.str());
29}
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:220
void HandleDiagnostic(clang::DiagnosticsEngine::Level Level, const clang::Diagnostic &Info) override
llvm::raw_string_ostream fOS
TClingDelegateDiagnosticPrinter(clang::DiagnosticOptions *DiagOpts, clang::LangOptions &LangOpts, handler_t fn)