[llvm] bc41653 - [ThreadPool] Use auto again for future with ENABLE_THREADS=Off.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 25 12:18:43 PST 2021


Author: Florian Hahn
Date: 2021-11-25T20:18:33Z
New Revision: bc41653a1f289a63a1472b7364437515c9659f77

URL: https://github.com/llvm/llvm-project/commit/bc41653a1f289a63a1472b7364437515c9659f77
DIFF: https://github.com/llvm/llvm-project/commit/bc41653a1f289a63a1472b7364437515c9659f77.diff

LOG: [ThreadPool] Use auto again for future with ENABLE_THREADS=Off.

This fixes a build failure with LLVM_ENABLE_THREADS=Off.

Added: 
    

Modified: 
    llvm/include/llvm/Support/ThreadPool.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index 4f6ccc069f0fc..8d30e8e92755a 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -122,8 +122,7 @@ class ThreadPool {
 #else // LLVM_ENABLE_THREADS Disabled
 
     // Get a Future with launch::deferred execution using std::async
-    std::future<void> Future =
-        std::async(std::launch::deferred, std::move(Task)).share();
+    auto Future = std::async(std::launch::deferred, std::move(Task)).share();
     // Wrap the future so that both ThreadPool::wait() can operate and the
     // returned future can be sync'ed on.
     Tasks.push([Future]() { Future.get(); });


        


More information about the llvm-commits mailing list