Skip to content

[cherry-pick][lldb] Check if C++ interop and embedded Swift are enabled on CU instead of whole module #10303

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

Conversation

augusto2112
Copy link

@augusto2112 augusto2112 commented Mar 19, 2025

Explanation: this fixes a regression where LLDB scans all of the compile units of a module to find out if a program was compiled with C++ interop or Embedded Swift enabled, and instead only parses one compile unit to find out that information. This mainly affects debugging very large programs, which are slowed by multiple seconds without the fix.
Risk: Low. The commit with the biggest change was shipped in release/6.0 (here) but somehow was not cherry picked into 6.1. The other two, more recent commits simply reuse the functionality in new call sites.
Issues: rdar://147009063
Original PRs: #10279
Reviewers: @adrian-prantl @kastiglione

Checking if C++ interop is enabled can be extremely slow if the project
is big enough. We have changed this to checking only the compile unit
instead, but one usage of the old API slipped by.

rdar://147009063
(cherry picked from commit e1099ae)
When deciding whether to format a C++ type as a Swiftified type or not,
checking if Swift/C++ interop is enabled on the entire target can be
very expensive for big projects, and may not swiftify types that should
be.

rdar://117708944
(cherry picked from commit fe06ebc)
(cherry picked from commit 234b15b)
Reading debug info of an entire module to check whether embedded Swift
is enabled or not can be very slow. This patch replaces that check with
only checking the compile unit instead.

rdar://147009063
(cherry picked from commit 03ee42c)
@augusto2112 augusto2112 requested a review from a team as a code owner March 19, 2025 23:49
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112 augusto2112 changed the title Cherry-pick compile unit checks [cherry-pick][lldb] Check if C++ interop and embedded Swift are enabled on CU instead of whole module Mar 20, 2025
@augusto2112
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl requested a review from fredriss March 21, 2025 17:34
@chiragramani
Copy link

Thanks for this! 🙌
It would be great if this could be included in release/6.1 - hoping it's still possible to get it into Xcode 16.3.

@adrian-prantl adrian-prantl merged commit 901f898 into swiftlang:swift/release/6.1 Mar 25, 2025
3 checks passed
@adrian-prantl
Copy link

Having merged this, it will be available in the downloadable nightly toolchains. I cannot comment on future Xcode releases.

@chiragramani
Copy link

Thank you so much @adrian-prantl and team 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants