1341825Sdim//===--- SerializedDiagnosticPrinter.h - Diagnostics serializer -*- C++ -*-===// 2234287Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6234287Sdim// 7234287Sdim//===----------------------------------------------------------------------===// 8234287Sdim 9280031Sdim#ifndef LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H 10280031Sdim#define LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H 11234287Sdim 12249423Sdim#include "clang/Basic/LLVM.h" 13280031Sdim#include "clang/Frontend/SerializedDiagnostics.h" 14353358Sdim#include "llvm/Bitstream/BitstreamWriter.h" 15234287Sdim 16234287Sdimnamespace llvm { 17234287Sdimclass raw_ostream; 18234287Sdim} 19234287Sdim 20234287Sdimnamespace clang { 21234287Sdimclass DiagnosticConsumer; 22234287Sdimclass DiagnosticsEngine; 23234287Sdimclass DiagnosticOptions; 24234287Sdim 25234287Sdimnamespace serialized_diags { 26234287Sdim 27341825Sdim/// Returns a DiagnosticConsumer that serializes diagnostics to 28234287Sdim/// a bitcode file. 29234287Sdim/// 30234287Sdim/// The created DiagnosticConsumer is designed for quick and lightweight 31341825Sdim/// transfer of diagnostics to the enclosing build system (e.g., an IDE). 32234287Sdim/// This allows wrapper tools for Clang to get diagnostics from Clang 33234287Sdim/// (via libclang) without needing to parse Clang's command line output. 34234287Sdim/// 35280031Sdimstd::unique_ptr<DiagnosticConsumer> create(StringRef OutputFile, 36280031Sdim DiagnosticOptions *Diags, 37280031Sdim bool MergeChildRecords = false); 38234287Sdim 39234287Sdim} // end serialized_diags namespace 40234287Sdim} // end clang namespace 41234287Sdim 42234287Sdim#endif 43