 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
100.0% |
2 / 2 |
| |
 |
|
 |
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 :
16 : #include "clang-c/Index.h"
17 : #include "clang/Basic/Diagnostic.h"
18 : #include "clang/Basic/LangOptions.h"
19 :
20 : namespace llvm { namespace sys {
21 : class Path;
22 : } }
23 :
24 : namespace clang {
25 :
26 : class Diagnostic;
27 : class LangOptions;
28 : class Preprocessor;
29 :
30 : /**
31 : * \brief Diagnostic client that translates Clang diagnostics into diagnostics
32 : * for the C interface to Clang.
33 : */
34 : class CIndexDiagnosticClient : public DiagnosticClient {
35 : CXDiagnosticCallback Callback;
36 : CXClientData ClientData;
37 : const LangOptions *LangOptsPtr;
38 :
39 : public:
40 : CIndexDiagnosticClient(CXDiagnosticCallback Callback,
41 69: CXClientData ClientData)
42 69: : Callback(Callback), ClientData(ClientData), LangOptsPtr(0) { }
43 :
44 : virtual ~CIndexDiagnosticClient();
45 :
46 : virtual void BeginSourceFile(const LangOptions &LangOpts,
47 : const Preprocessor *PP);
48 :
49 : virtual void EndSourceFile();
50 :
51 : virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
52 : const DiagnosticInfo &Info);
53 : };
54 :
55 : /// \brief Given the path to a file that contains binary, serialized
56 : /// diagnostics produced by Clang, emit those diagnostics via the
57 : /// given diagnostic engine.
58 : void ReportSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
59 : Diagnostic &Diags,
60 : unsigned num_unsaved_files,
61 : struct CXUnsavedFile *unsaved_files,
62 : const LangOptions &LangOpts);
63 :
64 : } // end namespace clang
65 :
66 : #endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H
Generated: 2010-02-10 01:31 by zcov