[clangd] Fix a data race in TUScheduler
authorIlya Biryukov <ibiryukov@google.com>
Thu, 28 Jun 2018 11:04:45 +0000 (11:04 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Thu, 28 Jun 2018 11:04:45 +0000 (11:04 +0000)
commitba7b824939e6c0f4fac7d0d7ba816e09052fd480
tree72fc0d041ab40401c3aa013e10c96ffb497cdb91
parentb03ed5e41490b2654aac53569d742d6cef44ad66
[clangd] Fix a data race in TUScheduler

By recomputing CompilerInvocation instead of copying it.
The problem was caused by the fact that copies of CompilerInvocation
store references to the shared state (DiagnosticOptions) when copied,
causing data races when two different copies are destroyed from
different threads.

llvm-svn: 335836
clang-tools-extra/clangd/TUScheduler.cpp