-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add a SWIFT_STDLIB_LLVM_LTO CMake option to enable building stdlib with LTO #34972
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1161,7 +1161,9 @@ function(_add_swift_target_library_single target name) | |
set(analyze_code_coverage "${SWIFT_ANALYZE_CODE_COVERAGE}") | ||
endif() | ||
|
||
if (NOT SWIFTLIB_SINGLE_TARGET_LIBRARY) | ||
if(SWIFTLIB_SINGLE_TARGET_LIBRARY) | ||
set(lto_type "${SWIFT_STDLIB_LLVM_LTO}") | ||
else() | ||
set(lto_type "${SWIFT_TOOLS_ENABLE_LTO}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this may be dead code, not sure if you have the time/interest/inclination to check and cleanup. It was here before though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I fail to understand what does "SWIFTLIB_SINGLE_TARGET_LIBRARY" mean and also what it means when it's set or not set. I just noticed in git history that "being set" is used to mean "we're building the stdlib", so that's how I'm using it here too. It's used in a whole bunch of places, though, so I'm a bit worried about just eliminating it... Do you have any more knowledge you could share here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its dead code, its from before CMake supported Swift properly and the custom build system implementation in Swift. The |
||
endif() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of
SWIFT_STDLIB_LTO_TYPE
and having the options ofnone
,thin
, andfull
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: The frontend values for lto are called "llvm-thin" and "llvm-full", I assume to explicitly point out they're enabling LLVM IR LTO, and not any other form of LTO (future SIL LTO, perhaps). Should we keep the "LLVM" name in the variable? Or in the values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
llvm-thin
andllvm-lto
for the values is reasonable. The less we have to munge the values, the better.