Skip to content

[lldb] Try GetTargetWP before GetSwiftASTContext #6656

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 16, 2023

LookupClangType needs the Target instance, and it has used GetSwiftASTContext to get to the target. It does not need anything directly from the ASTContext. To avoid unnecessarily loading Swift ASTContexts from TypeSystemSwiftTypeRef, this change tries GetTargetWP first, and if that succeeds, then the call to GetSwiftASTContext can be avoided entirely.

@kastiglione kastiglione marked this pull request as draft April 16, 2023 17:59
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test macOS Platform

@kastiglione kastiglione marked this pull request as ready for review April 17, 2023 15:38
@kastiglione kastiglione merged commit 2e31fa3 into swift/release/5.9 Apr 17, 2023
@kastiglione kastiglione deleted the dl/lldb-try-gettargetwp-before-getswiftastcontext branch April 17, 2023 18:31
kastiglione added a commit that referenced this pull request May 5, 2023
`LookupClangType` needs the `Target` instance, and it has used `GetSwiftASTContext` to get to the target. It does not need anything directly from the ASTContext. To avoid unnecessarily loading Swift ASTContexts from `TypeSystemSwiftTypeRef`, this change tries `GetTargetWP` first, and if that succeeds, then the call to `GetSwiftASTContext` can be avoided entirely.

(cherry-picked from commit 2e31fa3)
kastiglione added a commit that referenced this pull request May 5, 2023
`LookupClangType` needs the `Target` instance, and it has used `GetSwiftASTContext` to get to the target. It does not need anything directly from the ASTContext. To avoid unnecessarily loading Swift ASTContexts from `TypeSystemSwiftTypeRef`, this change tries `GetTargetWP` first, and if that succeeds, then the call to `GetSwiftASTContext` can be avoided entirely.

(cherry-picked from commit 2e31fa3)
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.

2 participants