tooling::CompileCommand OldCommand = std::move(FileInputs.CompileCommand);
FileInputs = Inputs;
- // Remove the old AST if it's still in cache.
- IdleASTs.take(this);
log("Updating file {0} with command [{1}] {2}", FileName,
Inputs.CompileCommand.Directory,
buildCompilerInvocation(Inputs);
if (!Invocation) {
elog("Could not build CompilerInvocation for file {0}", FileName);
+ // Remove the old AST if it's still in cache.
+ IdleASTs.take(this);
// Make sure anyone waiting for the preamble gets notified it could not
// be built.
PreambleWasBuilt.notify();
FileName);
return;
}
+ // Remove the old AST if it's still in cache.
+ IdleASTs.take(this);
+
// Build the AST for diagnostics.
llvm::Optional<ParsedAST> AST =
buildAST(FileName, std::move(Invocation), Inputs, NewPreamble, PCHs);