forked from OSchip/llvm-project
Revert r143342. Caching of code-completion results was intentionally placed in "reparse"
because we don't want to take this performance hit when doing code completion Log of r143342: Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete, so that it will happen when we are doing code-completion, not reparsing. llvm-svn: 143367
This commit is contained in:
parent
aff3640d13
commit
3689337c8e
|
@ -1943,6 +1943,12 @@ bool ASTUnit::Reparse(RemappedFile *RemappedFiles, unsigned NumRemappedFiles) {
|
|||
// Parse the sources
|
||||
bool Result = Parse(OverrideMainBuffer);
|
||||
|
||||
// If we're caching global code-completion results, and the top-level
|
||||
// declarations have changed, clear out the code-completion cache.
|
||||
if (!Result && ShouldCacheCodeCompletionResults &&
|
||||
CurrentTopLevelHashValue != CompletionCacheTopLevelHashValue)
|
||||
CacheCodeCompletionResults();
|
||||
|
||||
// We now need to clear out the completion allocator for
|
||||
// clang_getCursorCompletionString; it'll be recreated if necessary.
|
||||
CursorCompletionAllocator = 0;
|
||||
|
@ -2202,12 +2208,6 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
|
|||
if (!Invocation)
|
||||
return;
|
||||
|
||||
// If we're caching global code-completion results, and the top-level
|
||||
// declarations have changed, clear out the code-completion cache.
|
||||
if (ShouldCacheCodeCompletionResults &&
|
||||
CurrentTopLevelHashValue != CompletionCacheTopLevelHashValue)
|
||||
CacheCodeCompletionResults();
|
||||
|
||||
SimpleTimer CompletionTimer(WantTiming);
|
||||
CompletionTimer.setOutput("Code completion @ " + File + ":" +
|
||||
Twine(Line) + ":" + Twine(Column));
|
||||
|
|
Loading…
Reference in New Issue