diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h index 9272760fc140a..4bc4d90713493 100644 --- a/llvm/include/llvm/Support/ThreadPool.h +++ b/llvm/include/llvm/Support/ThreadPool.h @@ -224,6 +224,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;