Skip to content

AST: Store AvailableAttr's rename decl in split request evaluator storage #77818

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 7 commits into from
Dec 2, 2024

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Nov 22, 2024

Make the memory footprint of AvailableAttr smaller by optimizing for the common case of no rename: decl being associated with the attribute.

Wrap `RenamedDeclRequest` instead of evaluating it directly.
In the common case where there is no renamed decl for the attribute, just set a
few bits in inline storage for `AvailableAttr`.
This unblocks removing `RenameDecl` from `AvailableAttr`.
Rename decls are typically derived from the rename strings attached to a
`@available` attributes. It shouldn't be necessary to serialize the cached
rename decls since they can be rederived. The only decls that have rename decls
and don't have reanme strings are synthesized by ClangImporter and don't get
serialized.
The renamed decl is now stored exclusively in the split request evaluator
storage, which is more efficient since most availability attributes do not
specify a renamed decl.
@tshortli tshortli force-pushed the renamed-decl-requestification branch from 41864cb to cd13d7d Compare November 29, 2024 15:36
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli marked this pull request as ready for review December 1, 2024 23:27
@tshortli tshortli changed the title AST: Store AvailableAttr's rename decl in split request evaluator storage AST: Store AvailableAttr's rename decl in split request evaluator storage Dec 1, 2024
@tshortli tshortli merged commit 669930e into swiftlang:main Dec 2, 2024
5 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