Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports
index 2c73819..1c445b7 100644
--- a/tools/CIndex/CIndex.exports
+++ b/tools/CIndex/CIndex.exports
@@ -1,9 +1,12 @@
 _clang_annotateTokens
 _clang_codeComplete
+_clang_codeCompleteGetDiagnostic
+_clang_codeCompleteGetNumDiagnostics
 _clang_createIndex
 _clang_createTranslationUnit
 _clang_createTranslationUnitFromSourceFile
 _clang_disposeCodeCompleteResults
+_clang_disposeDiagnostic
 _clang_disposeIndex
 _clang_disposeString
 _clang_disposeTokens
@@ -25,6 +28,7 @@
 _clang_getCursorSpelling
 _clang_getCursorUSR
 _clang_getDefinitionSpellingAndExtent
+_clang_getDiagnostic
 _clang_getDiagnosticFixItInsertion
 _clang_getDiagnosticFixItKind
 _clang_getDiagnosticFixItRemoval
@@ -45,6 +49,7 @@
 _clang_getNullLocation
 _clang_getNullRange
 _clang_getNumCompletionChunks
+_clang_getNumDiagnostics
 _clang_getRange
 _clang_getRangeEnd
 _clang_getRangeStart