blob: 79a5df03812d8e049c6df7b42aaa0ac56d2c99ef [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
16#include "clang-c/Index.h"
17#include "clang/Basic/Diagnostic.h"
18#include "clang/Basic/LangOptions.h"
Douglas Gregora88084b2010-02-18 18:08:43 +000019#include "llvm/ADT/SmallVector.h"
Douglas Gregor5352ac02010-01-28 00:27:43 +000020
Douglas Gregord93256e2010-01-28 06:00:51 +000021namespace llvm { namespace sys {
22class Path;
23} }
24
Douglas Gregor5352ac02010-01-28 00:27:43 +000025namespace clang {
26
Douglas Gregord93256e2010-01-28 06:00:51 +000027class Diagnostic;
Daniel Dunbar35b84402010-01-30 23:31:40 +000028class LangOptions;
Douglas Gregor5352ac02010-01-28 00:27:43 +000029class Preprocessor;
Daniel Dunbar49146122010-01-30 23:31:49 +000030
Douglas Gregora88084b2010-02-18 18:08:43 +000031/// \brief The storage behind a CXDiagnostic
32struct CXStoredDiagnostic {
33 const StoredDiagnostic &Diag;
34 const LangOptions &LangOpts;
35
36 CXStoredDiagnostic(const StoredDiagnostic &Diag,
37 const LangOptions &LangOpts)
38 : Diag(Diag), LangOpts(LangOpts) { }
Douglas Gregor5352ac02010-01-28 00:27:43 +000039};
Douglas Gregora88084b2010-02-18 18:08:43 +000040
Douglas Gregord93256e2010-01-28 06:00:51 +000041/// \brief Given the path to a file that contains binary, serialized
Douglas Gregora88084b2010-02-18 18:08:43 +000042/// diagnostics produced by Clang, load those diagnostics.
43void LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
44 unsigned num_unsaved_files,
45 struct CXUnsavedFile *unsaved_files,
46 FileManager &FileMgr,
47 SourceManager &SourceMgr,
48 llvm::SmallVectorImpl<StoredDiagnostic> &Diags);
Douglas Gregord93256e2010-01-28 06:00:51 +000049
Douglas Gregor5352ac02010-01-28 00:27:43 +000050} // end namespace clang
51
52#endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H