Skip to content

[lldb] Lazily load Swift ASTContext in GetClangTypeNode #6629

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

kastiglione
Copy link

@kastiglione kastiglione commented Apr 11, 2023

Avoid unnecessarily loading the Swift ASTContext from GetClangTypeNode.

This Impl variable is used from MappedTypes.def, but the only places it's used are:

Impl.SwiftContext.getSwiftName(KnownFoundationEntity::NSInteger),
Impl.SwiftContext.getSwiftName(KnownFoundationEntity::NSUInteger),

This means most types do not need the AST Context, and loading it is unnecessary work.

This change lazily loads the AST Context, only when getSwiftName is called.

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione marked this pull request as draft April 11, 2023 22:21
@kastiglione
Copy link
Author

I have a new approach that's I'll take.

@kastiglione
Copy link
Author

Hopefully this PR will be superseded by swiftlang/swift#65082

@kastiglione
Copy link
Author

Closing in favor of swiftlang/swift#65082 and #6634

@kastiglione kastiglione deleted the dl/lldb-lazily-load-swift-astcontext-in-getclangtypenode branch April 12, 2023 23:14
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