-
Notifications
You must be signed in to change notification settings - Fork 10.5k
optimize flag computation #31125
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
optimize flag computation #31125
Conversation
@swift-ci please clean test |
Build failed |
Build failed |
Apply constant value propagation to the host flag variant operations. This reduces the parameters needed for the invocations and enables further cleaning in the hopes that we can apply these per-target using CMake instead.
Perform some constant folding, constant value propagation, dead argument elimination over the flag computation methods. This reduces the unnecessary parameters and more clearly and succinctly describes what is happening.
Convert the out parameters for `_add_host_variant_link_flags` to use the target as an in-parameter. Doing so allows us to set the properties on the target directly rather than providing them as out parameters which then get set subsequently.
Convert the out parameters for `_add_host_variant_c_compile_flags` to use the target as an in-parameter. Doing so allows us to set the properties on the target directly rather than providing them as out parameters which then get set subsequently.
The host tools do not use ICU, only the standard library does. Remove the special handling in the host tool path for ICU. This simplifies the flag computation and allows the ICU handling to be sunk entirely into the target specific paths.
The two invocations here both had a single parameter passed to it. Replace it with `add_dependencies` which already actually supports multiple dependencies specified. Sink the custom wrapper into the usage location in `AddSwiftStdlib.cmake`.
Use a newly introduced `swift_gyb_target_sources` to gyb and use the generated sources when building. Let CMake figure out when to run the command, let it invoke the command properly, and indicate that the sources being added to the target are generated.
@swift-ci please clean test |
@swift-ci please test windows platform |
Build failed |
@swift-ci please smoke test Linux platform |
@swift-ci please test Linux platform |
@compnerd This probably caused build failures |
Following swiftlang#31125 and swiftlang#31612, `-target` is not added automatically to linker flags when that's needed (e.g. when building for Apple SDKs) -- mimic the logic used to add it for compiler flags. Addresses rdar://63138761
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.