CIndex: Fix ReportSerializedDiagnostics to honor the DiagnosticClient contract
that diagnostics with a source location should occur inside
{Begin,End}SourceFile.
Note that code completion is currently passing in an invalid LangOptions object
due to its implementation, I need to sort this out with Doug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94927 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 1afd8c2..718aff0 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -1095,7 +1095,8 @@
ATU->unlinkTemporaryFile();
ReportSerializedDiagnostics(DiagnosticsFile, *Diags,
- num_unsaved_files, unsaved_files);
+ num_unsaved_files, unsaved_files,
+ ATU->getASTContext().getLangOptions());
for (unsigned i = 0, e = TemporaryFiles.size(); i != e; ++i)
TemporaryFiles[i].eraseFromDisk();