From d6fef4220d4c889e2a07aa2e3a2b691ef6415e0f Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Thu, 13 Feb 2025 00:03:52 +0000 Subject: [PATCH] [DependencyScan] Use `llvm::DefaultThreadPool` instead of `llvm::StdThreadPool` `llvm::StdThreadPool` is only available when LLVM_ENABLE_THREADS is enabled. LLVM defines `DefaultThreadPool` type alias, which is always available regardless of the threads enabled. This change allows building the library without threads enabled, especially for Emscripten toolchain. ``` #if LLVM_ENABLE_THREADS using DefaultThreadPool = StdThreadPool; #else using DefaultThreadPool = SingleThreadExecutor; #endif ``` --- include/swift/DependencyScan/ModuleDependencyScanner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/swift/DependencyScan/ModuleDependencyScanner.h b/include/swift/DependencyScan/ModuleDependencyScanner.h index 2ca1b6542a712..44a2f9cce99c7 100644 --- a/include/swift/DependencyScan/ModuleDependencyScanner.h +++ b/include/swift/DependencyScan/ModuleDependencyScanner.h @@ -180,7 +180,7 @@ class ModuleDependencyScanner { /// The available pool of workers for filesystem module search unsigned NumThreads; std::list> Workers; - llvm::StdThreadPool ScanningThreadPool; + llvm::DefaultThreadPool ScanningThreadPool; /// Protect worker access. std::mutex WorkersLock; /// Count of filesystem queries performed