CIndexDiagnostic.h revision f51f20fa34654da75d15a9e2a1a0cd2fc0d8603d
1/*===-- CIndexDiagnostic.h - Diagnostics C Interface ------------*- C++ -*-===*\
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|* Implements the diagnostic functions of the Clang C interface.              *|
11|*                                                                            *|
12\*===----------------------------------------------------------------------===*/
13#ifndef LLVM_CLANG_CINDEX_DIAGNOSTIC_H
14#define LLVM_CLANG_CINDEX_DIAGNOSTIC_H
15
16struct CXUnsavedFile;
17
18namespace llvm {
19template<typename T> class SmallVectorImpl;
20namespace sys { class Path; }
21}
22
23namespace clang {
24
25class Diagnostic;
26class FileManager;
27class LangOptions;
28class Preprocessor;
29class StoredDiagnostic;
30class SourceManager;
31
32/// \brief The storage behind a CXDiagnostic
33struct CXStoredDiagnostic {
34  const StoredDiagnostic &Diag;
35  const LangOptions &LangOpts;
36
37  CXStoredDiagnostic(const StoredDiagnostic &Diag,
38                     const LangOptions &LangOpts)
39    : Diag(Diag), LangOpts(LangOpts) { }
40};
41
42/// \brief Given the path to a file that contains binary, serialized
43/// diagnostics produced by Clang, load those diagnostics.
44void LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
45                               unsigned num_unsaved_files,
46                               struct CXUnsavedFile *unsaved_files,
47                               FileManager &FileMgr,
48                               SourceManager &SourceMgr,
49                               llvm::SmallVectorImpl<StoredDiagnostic> &Diags);
50
51} // end namespace clang
52
53#endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H
54