Skip to content

[AST] Convert ASTContext::getSwiftName to a free function #65082

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

Conversation

kastiglione
Copy link
Contributor

@kastiglione kastiglione commented Apr 11, 2023

The only state getSwiftName uses is its argument, and can be made a free function. Of note, the inverse operation, getKnownFoundationEntity, is also a free function. This removes the requirement that callers have an ASTContext instance.


Cherry-pick of #65194.

@kastiglione
Copy link
Contributor Author

kastiglione commented Apr 11, 2023

This helps lldb avoid creating ASTContexts (which can be costly), before they're really needed.

The only state `getSwiftName` uses is its argument, and can be made a free function. Of
note the inverse operation, `getKnownFoundationEntity`, is also a free function. This
removes the requirement that callers have an `ASTContext` instance.
@kastiglione kastiglione force-pushed the dl/ast-convert-astcontext-getswiftname-to-static branch from 5df8173 to fb524c0 Compare April 12, 2023 15:49
@kastiglione kastiglione changed the title [AST] Convert ASTContext::getSwiftName to static [AST] Convert ASTContext::getSwiftName to a free function Apr 12, 2023
@kastiglione
Copy link
Contributor Author

@swift-ci smoke test

@kastiglione
Copy link
Contributor Author

swiftlang/llvm-project#6634
@swift-ci smoke test

1 similar comment
@kastiglione
Copy link
Contributor Author

swiftlang/llvm-project#6634
@swift-ci smoke test

@kastiglione
Copy link
Contributor Author

@swift-ci test macOS Platform

@kastiglione
Copy link
Contributor Author

@swift-ci test Linux Platform

@kastiglione
Copy link
Contributor Author

swiftlang/llvm-project#6634
@swift-ci test Linux Platform

@kastiglione
Copy link
Contributor Author

swiftlang/llvm-project#6634
@swift-ci test macOS Platform

@kastiglione kastiglione merged commit 1820cfe into release/5.9 Apr 14, 2023
@kastiglione kastiglione deleted the dl/ast-convert-astcontext-getswiftname-to-static branch April 14, 2023 14:26
@shahmishal
Copy link
Member

Is this change on main?

@kastiglione
Copy link
Contributor Author

Here's the cherry pick for main #65194

@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants