[Tooling] Wait for all threads to finish before resetting CWD.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342028 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Liu 2018-09-12 08:29:47 +00:00
parent 6208c64db7
commit fc01a51bbe
1 changed files with 2 additions and 0 deletions

View File

@ -129,6 +129,8 @@ llvm::Error AllTUsToolExecutor::execute(
},
File);
}
// Make sure all tasks have finished before resetting the working directory.
Pool.wait();
if (!InitialWorkingDir.empty()) {
if (auto EC = llvm::sys::fs::set_current_path(InitialWorkingDir))
llvm::errs() << "Error while restoring working directory: "