]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
MFC r234353:
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / Frontend / SerializedDiagnosticPrinter.h
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_SERIALIZE_DIAGNOSTIC_PRINTER_H_
11 #define LLVM_CLANG_FRONTEND_SERIALIZE_DIAGNOSTIC_PRINTER_H_
12
13 #include "llvm/Bitcode/BitstreamWriter.h"
14
15 namespace llvm {
16 class raw_ostream;
17 }
18
19 namespace clang {
20 class DiagnosticConsumer;
21 class DiagnosticsEngine;
22 class DiagnosticOptions;
23
24 namespace serialized_diags {
25   
26 enum BlockIDs {
27   /// \brief A top-level block which represents any meta data associated
28   /// with the diagostics, including versioning of the format.
29   BLOCK_META = llvm::bitc::FIRST_APPLICATION_BLOCKID,
30
31   /// \brief The this block acts as a container for all the information
32   /// for a specific diagnostic.
33   BLOCK_DIAG
34 };
35
36 enum RecordIDs {
37   RECORD_VERSION = 1,
38   RECORD_DIAG,
39   RECORD_SOURCE_RANGE,
40   RECORD_DIAG_FLAG,
41   RECORD_CATEGORY,
42   RECORD_FILENAME,
43   RECORD_FIXIT,
44   RECORD_FIRST = RECORD_VERSION,
45   RECORD_LAST = RECORD_FIXIT
46 };
47
48 /// \brief Returns a DiagnosticConsumer that serializes diagnostics to
49 ///  a bitcode file.
50 ///
51 /// The created DiagnosticConsumer is designed for quick and lightweight
52 /// transfer of of diagnostics to the enclosing build system (e.g., an IDE).
53 /// This allows wrapper tools for Clang to get diagnostics from Clang
54 /// (via libclang) without needing to parse Clang's command line output.
55 ///
56 DiagnosticConsumer *create(llvm::raw_ostream *OS,
57                            const DiagnosticOptions &diags);
58
59 } // end serialized_diags namespace
60 } // end clang namespace
61
62 #endif