Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 1 | /*===-- CIndexDiagnostic.h - Diagnostics C Interface ------------*- C++ -*-===*\ |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 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 | |
| 16 | #include "clang-c/Index.h" |
| 17 | #include "clang/Basic/Diagnostic.h" |
| 18 | #include "clang/Basic/LangOptions.h" |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/SmallVector.h" |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 20 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 21 | namespace llvm { namespace sys { |
| 22 | class Path; |
| 23 | } } |
| 24 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 25 | namespace clang { |
| 26 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 27 | class Diagnostic; |
Daniel Dunbar | 35b8440 | 2010-01-30 23:31:40 +0000 | [diff] [blame] | 28 | class LangOptions; |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 29 | class Preprocessor; |
Daniel Dunbar | 4914612 | 2010-01-30 23:31:49 +0000 | [diff] [blame] | 30 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 31 | /// \brief The storage behind a CXDiagnostic |
| 32 | struct 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 Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 39 | }; |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 40 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 41 | /// \brief Given the path to a file that contains binary, serialized |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 42 | /// diagnostics produced by Clang, load those diagnostics. |
| 43 | void 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 Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 49 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 50 | } // end namespace clang |
| 51 | |
| 52 | #endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H |