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 | |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 16 | struct CXUnsavedFile; |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 17 | |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 18 | namespace llvm { |
| 19 | template<typename T> class SmallVectorImpl; |
| 20 | namespace sys { class Path; } |
| 21 | } |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 22 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 23 | namespace clang { |
| 24 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 25 | class Diagnostic; |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 26 | class FileManager; |
Daniel Dunbar | 35b8440 | 2010-01-30 23:31:40 +0000 | [diff] [blame] | 27 | class LangOptions; |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 28 | class Preprocessor; |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 29 | class StoredDiagnostic; |
| 30 | class SourceManager; |
Daniel Dunbar | 4914612 | 2010-01-30 23:31:49 +0000 | [diff] [blame] | 31 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 32 | /// \brief The storage behind a CXDiagnostic |
| 33 | struct 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 Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 40 | }; |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 41 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 42 | /// \brief Given the path to a file that contains binary, serialized |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 43 | /// diagnostics produced by Clang, load those diagnostics. |
| 44 | void 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 Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 50 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 51 | } // end namespace clang |
| 52 | |
| 53 | #endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H |