From d64f4c14029f970caafb0bdfcf07f9fecfe5c68b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 9 Dec 2010 21:27:43 +0000 Subject: [PATCH] Gather cached code completions after the first reparse, not after the second reparse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/ASTUnit.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 97e03266eb..d042f3fb85 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -848,6 +848,14 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) { } Invocation.reset(Clang.takeInvocation()); + + if (ShouldCacheCodeCompletionResults) { + if (CacheCodeCompletionCoolDown > 0) + --CacheCodeCompletionCoolDown; + else if (top_level_size() != NumTopLevelDeclsAtLastCompletionCache) + CacheCodeCompletionResults(); + } + return false; error: @@ -1586,14 +1594,6 @@ bool ASTUnit::Reparse(RemappedFile *RemappedFiles, unsigned NumRemappedFiles) { // Parse the sources bool Result = Parse(OverrideMainBuffer); - - if (ShouldCacheCodeCompletionResults) { - if (CacheCodeCompletionCoolDown > 0) - --CacheCodeCompletionCoolDown; - else if (top_level_size() != NumTopLevelDeclsAtLastCompletionCache) - CacheCodeCompletionResults(); - } - return Result; } -- 2.50.1