blob: 919c21cfdbe4c96637531e372b4dfdb8c83fad90 [file] [log] [blame]
Douglas Gregord93256e2010-01-28 06:00:51 +00001/*===-- CIndexDiagnostic.h - Diagnostics C Interface ------------*- C++ -*-===*\
Douglas Gregor5352ac02010-01-28 00:27:43 +00002|* *|
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
Benjamin Kramerb846deb2010-04-12 19:45:50 +000016struct CXUnsavedFile;
Douglas Gregor5352ac02010-01-28 00:27:43 +000017
Benjamin Kramerb846deb2010-04-12 19:45:50 +000018namespace llvm {
19template<typename T> class SmallVectorImpl;
20namespace sys { class Path; }
21}
Douglas Gregord93256e2010-01-28 06:00:51 +000022
Douglas Gregor5352ac02010-01-28 00:27:43 +000023namespace clang {
24
Douglas Gregord93256e2010-01-28 06:00:51 +000025class Diagnostic;
Benjamin Kramerb846deb2010-04-12 19:45:50 +000026class FileManager;
Daniel Dunbar35b84402010-01-30 23:31:40 +000027class LangOptions;
Douglas Gregor5352ac02010-01-28 00:27:43 +000028class Preprocessor;
Benjamin Kramerb846deb2010-04-12 19:45:50 +000029class StoredDiagnostic;
30class SourceManager;
Daniel Dunbar49146122010-01-30 23:31:49 +000031
Douglas Gregora88084b2010-02-18 18:08:43 +000032/// \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) { }
Douglas Gregor5352ac02010-01-28 00:27:43 +000040};
Douglas Gregora88084b2010-02-18 18:08:43 +000041
Douglas Gregord93256e2010-01-28 06:00:51 +000042/// \brief Given the path to a file that contains binary, serialized
Douglas Gregora88084b2010-02-18 18:08:43 +000043/// 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);
Douglas Gregord93256e2010-01-28 06:00:51 +000050
Douglas Gregor5352ac02010-01-28 00:27:43 +000051} // end namespace clang
52
53#endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H