Skip to content

[lldb] Change LLDBTypeInfoProvider to a local (per-module) TypeSystem… #10373

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

Merged
merged 1 commit into from
Mar 30, 2025

Conversation

adrian-prantl
Copy link

…Swift

The decision of using a scratch context in TIP was made because reading types from a Process' reflection metadata can return types outside of the current lldb_private::Module. That'd be a huge problem for SwiftASTContext because it would pollute the context with ASTs from outside the Module, but TypeSystemSwiftTypeRef only deals in type names, which makes it immune to these risks.

This change allows TypeAlias lookups to be made locally, which can dramatically speed up type resolution. In a real-world benchmark of printing self in a large Swift/ObjC application the time spent in FindTypes() goes from 50% to it not even showing up on the profile.

rdar://145884579

@adrian-prantl adrian-prantl requested a review from a team as a code owner March 28, 2025 22:28
…Swift

The decision of using a scratch context in TIP was made because
reading types from a Process' reflection metadata can return types
outside of the current lldb_private::Module. That'd be a huge problem
for SwiftASTContext because it would pollute the context with ASTs
from outside the Module, but TypeSystemSwiftTypeRef only deals in type
names, which makes it immune to these risks.

This change allows TypeAlias lookups to be made locally, which can
dramatically speed up type resolution.  In a real-world benchmark of
printing self in a large Swift/ObjC application the time spent in
FindTypes() goes from 50% to it not even showing up on the profile.

rdar://145884579
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 7194803 into swiftlang:stable/20240723 Mar 30, 2025
3 checks passed
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.

1 participant