Home | History | Annotate | Download | only in Frontend
      1 //===--- SerializedDiagnosticPrinter.h - Serializer for diagnostics -------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 #ifndef LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H
     11 #define LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICPRINTER_H
     12 
     13 #include "clang/Basic/LLVM.h"
     14 #include "clang/Frontend/SerializedDiagnostics.h"
     15 #include "llvm/Bitcode/BitstreamWriter.h"
     16 
     17 namespace llvm {
     18 class raw_ostream;
     19 }
     20 
     21 namespace clang {
     22 class DiagnosticConsumer;
     23 class DiagnosticsEngine;
     24 class DiagnosticOptions;
     25 
     26 namespace serialized_diags {
     27 
     28 /// \brief Returns a DiagnosticConsumer that serializes diagnostics to
     29 ///  a bitcode file.
     30 ///
     31 /// The created DiagnosticConsumer is designed for quick and lightweight
     32 /// transfer of of diagnostics to the enclosing build system (e.g., an IDE).
     33 /// This allows wrapper tools for Clang to get diagnostics from Clang
     34 /// (via libclang) without needing to parse Clang's command line output.
     35 ///
     36 std::unique_ptr<DiagnosticConsumer> create(StringRef OutputFile,
     37                                            DiagnosticOptions *Diags,
     38                                            bool MergeChildRecords = false);
     39 
     40 } // end serialized_diags namespace
     41 } // end clang namespace
     42 
     43 #endif
     44