summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-09 21:27:43 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-09 21:27:43 +0000
commitaca48a5aff6706f5c8251ffd32531cdb37772730 (patch)
tree204c25e77e42c11ef01441b423586bc0d58f8fac /clang/lib/Frontend/ASTUnit.cpp
parentd2ea97cbef829eec9845780e51e55860cd66cfbb (diff)
downloadbcm5719-llvm-aca48a5aff6706f5c8251ffd32531cdb37772730.tar.gz
bcm5719-llvm-aca48a5aff6706f5c8251ffd32531cdb37772730.zip
Gather cached code completions after the first reparse, not after the
second reparse. llvm-svn: 121413
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 97e03266ebe..d042f3fb857 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud