diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h index 1be7779f2c72c..4f91455f204fd 100644 --- a/llvm/include/llvm/Support/ThreadPool.h +++ b/llvm/include/llvm/Support/ThreadPool.h @@ -225,6 +225,12 @@ class LLVM_ABI SingleThreadExecutor : public ThreadPoolInterface { /// Blocking destructor: the pool will first execute the pending tasks. ~SingleThreadExecutor() override; + // Excplicitly disable copy. This is necessary for the MSVC LLVM_DYLIB build + // because MSVC tries to generate copy constructor and assignment operator + // for classes marked with `__declspec(dllexport)`. + SingleThreadExecutor(const SingleThreadExecutor &) = delete; + SingleThreadExecutor &operator=(const SingleThreadExecutor &) = delete; + /// Blocking wait for all the tasks to execute first void wait() override;