-
Notifications
You must be signed in to change notification settings - Fork 15.3k
llvm: Disable copy for SingleThreadExecutor #168782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm: Disable copy for SingleThreadExecutor #168782
Conversation
|
@llvm/pr-subscribers-llvm-support Author: Fabrice de Gans (Steelskin) ChangesThis is a workaround for the MSVC compiler, which attempts to generate a copy assignment operator implementation for classes marked as DevCom ticket: https://developercommunity.microsoft.com/t/Classes-marked-with-__declspecdllexport/11003192 Full diff: https://github.com/llvm/llvm-project/pull/168782.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index 1be7779f2c72c..933d3f43812ad 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -225,6 +225,13 @@ 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
+ // to work around a compiler bug where classes marked as
+ // `__declspec(dllexport)` cause the compiler to attempt to generate a copy
+ // assignment operator.
+ SingleThreadExecutor(const SingleThreadExecutor &) = delete;
+ SingleThreadExecutor &operator=(const SingleThreadExecutor &) = delete;
+
/// Blocking wait for all the tasks to execute first
void wait() override;
|
🐧 Linux x64 Test Results
|
This is a workaround for the MSVC compiler, which attempts to generate a copy assignment operator implementation for classes marked as `__declspec(dllexport)`. Explicitly marking the copy assignment operator as deleted works around the problem.
2fbb148 to
84a01ba
Compare
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/26924 Here is the relevant piece of the build log for the reference |
This is a workaround for the MSVC compiler, which attempts to generate a copy assignment operator implementation for classes marked as
__declspec(dllexport). Explicitly marking the copy assignment operator as deleted works around the problem.DevCom ticket: https://developercommunity.microsoft.com/t/Classes-marked-with-__declspecdllexport/11003192