aboutsummaryrefslogtreecommitdiff
path: root/tools/CIndex/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-30 23:31:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-30 23:31:40 +0000
commit35b8440f615a2336f2819a98a78fc89f07d905e1 (patch)
treec74e3eba70f1bfc2077c38bcb6d7c3438094191a /tools/CIndex/CIndexCodeCompletion.cpp
parent966146e89141804ff6492739a2a6e6592ca671c7 (diff)
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
Diffstat (limited to 'tools/CIndex/CIndexCodeCompletion.cpp')
-rw-r--r--tools/CIndex/CIndexCodeCompletion.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/CIndex/CIndexCodeCompletion.cpp b/tools/CIndex/CIndexCodeCompletion.cpp
index fe4eb8af11..4e41c5f1c7 100644
--- a/tools/CIndex/CIndexCodeCompletion.cpp
+++ b/tools/CIndex/CIndexCodeCompletion.cpp
@@ -178,6 +178,8 @@ struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
/// \brief The memory buffer from which we parsed the results. We
/// retain this buffer because the completion strings point into it.
llvm::MemoryBuffer *Buffer;
+
+ LangOptions LangOpts;
};
CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx,
@@ -339,8 +341,12 @@ CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx,
Results->Buffer = F;
}
+ // FIXME: The LangOptions we are passing here are not at all correct. However,
+ // in the current design we must pass something in so the SourceLocations have
+ // a LangOptions object to refer to.
ReportSerializedDiagnostics(DiagnosticsFile, *Diags,
- num_unsaved_files, unsaved_files);
+ num_unsaved_files, unsaved_files,
+ Results->LangOpts);
for (unsigned i = 0, e = TemporaryFiles.size(); i != e; ++i)
TemporaryFiles[i].eraseFromDisk();