diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-10 23:37:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-10 23:37:54 +0000 |
commit | b77d197a78b30030e34bc14c27d63afc757c7d3b (patch) | |
tree | 5acf0bca12bc6359a1b2d8b3cedc152496c5aa29 /tools/libclang/CIndexCodeCompletion.cpp | |
parent | 158ebfba7545b3a9947f87bed83ea710df95ac3d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r-- | tools/libclang/CIndexCodeCompletion.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index b419fd6850..3ce0d245cf 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -274,7 +274,12 @@ AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults( 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); |