Skip to content

Commit d6fef42

Browse files
[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 ```
1 parent 772cff1 commit d6fef42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/DependencyScan/ModuleDependencyScanner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ModuleDependencyScanner {
180180
/// The available pool of workers for filesystem module search
181181
unsigned NumThreads;
182182
std::list<std::unique_ptr<ModuleDependencyScanningWorker>> Workers;
183-
llvm::StdThreadPool ScanningThreadPool;
183+
llvm::DefaultThreadPool ScanningThreadPool;
184184
/// Protect worker access.
185185
std::mutex WorkersLock;
186186
/// Count of filesystem queries performed

0 commit comments

Comments
 (0)