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.

llvm-svn: 141598
This commit is contained in:
Douglas Gregor
2011-10-10 23:37:54 +00:00
parent ee3be4f2a9
commit e442fe3db9

View File

@@ -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);