8000 [Index] Only hash `Decl` once when generating the hash value for a record by ahoppen · Pull Request #10876 · swiftlang/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

[Index] Only hash Decl once when generating the hash value for a record #10876

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
Jun 24, 2025

Conversation

ahoppen
Copy link
Member
@ahoppen ahoppen commented Jun 20, 2025

Cherry-pick of #10846 to stable/20240723.


Say we are indexing the header file containing NSArray. Almost every declaration in here has a relation to NSArray (mostly child-of relations). This means that for every of those declarations we hash NSArray again by creating a DeclHashVisitor that, among others, adds the string NSArray to the hash builder.

To avoid this, keep track of all the declarations that we have already incorporated into the hash. If we did already hash the declaration, only incorporate an integer into the hash.

…cord

Say we are indexing the header file containing `NSArray`. Almost every declaration in here has a relation to `NSArray` (mostly child-of relations). This means that for every of those declarations we hash `NSArray` again by creating a `DeclHashVisitor` that, among others, adds the string `NSArray` to the hash builder.

To avoid this, keep track of all the declarations that we have already incorporated into the hash. If we did already hash the declaration, only incorporate an integer into the hash.
@ahoppen ahoppen requested a review from bnbarham June 20, 2025 10:59
@ahoppen ahoppen requested a review from a team as a code owner June 20, 2025 10:59
@ahoppen
Copy link
Member Author
ahoppen commented Jun 20, 2025

@swift-ci Please test llvm

@ahoppen
Copy link
Member Author
ahoppen commented Jun 23, 2025

@swift-ci Please test

@ahoppen ahoppen merged commit 3f4e1e2 into swiftlang:stable/20240723 Jun 24, 2025
5 checks passed
@ahoppen ahoppen deleted the stable/index-decl-once branch June 24, 2025 07:05
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.

3 participants
0