Fix build failure on windows system with msvc toolchain
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
ThreadPool.h ends up including immintrin.h from MSVC after builtin generation in clang and It has definitions for replacing one builtins with another.
Clang maintain a enum for all generated builtin but due to above macro replacement enum ends up having two element with same name and it causes multiple definitions error.
There are some other instances where ThreadPool.h is not included directly(i.e. Debuginfod.h).
I'm not understanding why this change fixes that since we are still including ThreadPool.h in BalancedPartitioning.cpp. This seems like something that should be fixed in ThreadPool.h itself.
llvm/include/llvm/Support/BalancedPartitioning.h | ||
---|---|---|
118 | Why not keep ThreadPool owned by BPThreadPool? Why make this an alias? |
Including ThreadPool.h in BalancedPartitioning.cpp is not an issue, issue comes when we include it in BalancedPartitioning.h.
llvm/include/llvm/Support/BalancedPartitioning.h | ||
---|---|---|
118 | We do not know complete type of ThreadPool here so we can not do that. |
llvm/lib/Support/BalancedPartitioning.cpp | ||
---|---|---|
84 | Lets move this line to be inside LLVM_ENABLE_THREADS because it won't be used if it's not enabled. |
Why not keep ThreadPool owned by BPThreadPool? Why make this an alias?