[cfe-commits] r121413 - /cfe/trunk/lib/Frontend/ASTUnit.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 9 13:27:43 PST 2010


Author: dgregor
Date: Thu Dec  9 15:27:43 2010
New Revision: 121413

URL: http://llvm.org/viewvc/llvm-project?rev=121413&view=rev
Log:
Gather cached code completions after the first reparse, not after the
second reparse.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=121413&r1=121412&r2=121413&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Dec  9 15:27:43 2010
@@ -848,6 +848,14 @@
   }
 
   Invocation.reset(Clang.takeInvocation());
+
+  if (ShouldCacheCodeCompletionResults) {
+    if (CacheCodeCompletionCoolDown > 0)
+      --CacheCodeCompletionCoolDown;
+    else if (top_level_size() != NumTopLevelDeclsAtLastCompletionCache)
+      CacheCodeCompletionResults();
+  }
+
   return false;
   
 error:
@@ -1586,14 +1594,6 @@
   
   // Parse the sources
   bool Result = Parse(OverrideMainBuffer);  
-  
-  if (ShouldCacheCodeCompletionResults) {
-    if (CacheCodeCompletionCoolDown > 0)
-      --CacheCodeCompletionCoolDown;
-    else if (top_level_size() != NumTopLevelDeclsAtLastCompletionCache)
-      CacheCodeCompletionResults();
-  }
-  
   return Result;
 }
 





More information about the cfe-commits mailing list