[cfe-commits] r141598 - /cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
Douglas Gregor
dgregor at apple.com
Mon Oct 10 16:37:54 PDT 2011
Author: dgregor
Date: Mon Oct 10 18:37:54 2011
New Revision: 141598
URL: http://llvm.org/viewvc/llvm-project?rev=141598&view=rev
Log:
Make sure we initialize the "extra" data within the libclang code
completion context, in case we end up having no code-completion
callback. Individual instances of this problem are always bugs that
need to be fixed, but it's better to make sure we have initialized
data here.
Modified:
cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
Modified: cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp?rev=141598&r1=141597&r2=141598&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp Mon Oct 10 18:37:54 2011
@@ -274,7 +274,12 @@
llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs))),
FileSystemOpts(FileSystemOpts),
FileMgr(new FileManager(FileSystemOpts)),
- SourceMgr(new SourceManager(*Diag, *FileMgr)) {
+ SourceMgr(new SourceManager(*Diag, *FileMgr)),
+ Contexts(CXCompletionContext_Unknown),
+ ContainerKind(CXCursor_InvalidCode),
+ ContainerUSR(createCXString("")),
+ ContainerIsIncomplete(1)
+{
if (getenv("LIBCLANG_OBJTRACKING")) {
llvm::sys::AtomicIncrement(&CodeCompletionResultObjects);
fprintf(stderr, "+++ %d completion results\n", CodeCompletionResultObjects);
More information about the cfe-commits
mailing list