]> granicus.if.org Git - clang/commitdiff
[Tooling] Wait for all threads to finish before resetting CWD.
authorEric Liu <ioeric@google.com>
Wed, 12 Sep 2018 08:29:47 +0000 (08:29 +0000)
committerEric Liu <ioeric@google.com>
Wed, 12 Sep 2018 08:29:47 +0000 (08:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/AllTUsExecution.cpp

index a7af541cc5d2d955ca163dec7fa2b289f7c992d6..0f56bbf13f79f446b1d7608daf54a8aba3eebb2c 100644 (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: "