clang API Documentation

SerializedDiagnosticPrinter.h
Go to the documentation of this file.
00001 //===--- SerializedDiagnosticPrinter.h - Serializer for diagnostics -------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_CLANG_FRONTEND_SERIALIZE_DIAGNOSTIC_PRINTER_H_
00011 #define LLVM_CLANG_FRONTEND_SERIALIZE_DIAGNOSTIC_PRINTER_H_
00012 
00013 #include "llvm/Bitcode/BitstreamWriter.h"
00014 
00015 namespace llvm {
00016 class raw_ostream;
00017 }
00018 
00019 namespace clang {
00020 class DiagnosticConsumer;
00021 class DiagnosticsEngine;
00022 class DiagnosticOptions;
00023 
00024 namespace serialized_diags {
00025   
00026 enum BlockIDs {
00027   /// \brief A top-level block which represents any meta data associated
00028   /// with the diagostics, including versioning of the format.
00029   BLOCK_META = llvm::bitc::FIRST_APPLICATION_BLOCKID,
00030 
00031   /// \brief The this block acts as a container for all the information
00032   /// for a specific diagnostic.
00033   BLOCK_DIAG
00034 };
00035 
00036 enum RecordIDs {
00037   RECORD_VERSION = 1,
00038   RECORD_DIAG,
00039   RECORD_SOURCE_RANGE,
00040   RECORD_DIAG_FLAG,
00041   RECORD_CATEGORY,
00042   RECORD_FILENAME,
00043   RECORD_FIXIT,
00044   RECORD_FIRST = RECORD_VERSION,
00045   RECORD_LAST = RECORD_FIXIT
00046 };
00047 
00048 /// \brief Returns a DiagnosticConsumer that serializes diagnostics to
00049 ///  a bitcode file.
00050 ///
00051 /// The created DiagnosticConsumer is designed for quick and lightweight
00052 /// transfer of of diagnostics to the enclosing build system (e.g., an IDE).
00053 /// This allows wrapper tools for Clang to get diagnostics from Clang
00054 /// (via libclang) without needing to parse Clang's command line output.
00055 ///
00056 DiagnosticConsumer *create(llvm::raw_ostream *OS,
00057                            const DiagnosticOptions &diags);
00058 
00059 } // end serialized_diags namespace
00060 } // end clang namespace
00061 
00062 #endif