This is an addition to D68950 which has been recently landed. It prevents adding -fsplit-lto-unit for Mac and PS4 thin LTO builds, because legacy LTO library is not capable of unit splitting.
Details
Diff Detail
Event Timeline
A small suggestion for improvement.
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5400 | I think this would be cleaner if we add a virtual function supportSplitLTOUnit to Toolchain, and let toolchain decide if it is supported, rather than hard code this in Clang.cpp. |
Addressed
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5400 | It doesn't make sense to use virtual function, because there is no toolchain class for PS4. I'd suggest make an ordinary member function checking triple |
That is not exactly what I meant. I meant:
in Toolchain.h: virtual bool canSplitThinLTOUnit() const { return true; }
in lib/lib/Driver/ToolChains/{PS4CPU.h,Darwin.h}: return false; // Using legacy LTO library
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5400 | PS4CPU.h is not PS4 toolchain? If there is no PS4 toolchain, let's stick with your original patch. |
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5400 | Hm... I somehow didn't realized that PS4CPU is derived from ToolChain. I'll update the patch |
I think this would be cleaner if we add a virtual function supportSplitLTOUnit to Toolchain, and let toolchain decide if it is supported, rather than hard code this in Clang.cpp.