[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)
llvm-svn: 342028

clang/lib/Tooling/AllTUsExecution.cpp

index a7af541..0f56bbf 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: "