Skip to content

Accommodate 64-bit clang serialization IDs #75513

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

Closed
wants to merge 1 commit into from

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Jul 26, 2024

Several serialization IDs that used to be 32 bits are being widened to 64. Modify SwiftLookupTable and its supporting types to accommodate this.

The new design uses a 64-bit integer for the pointer, decl, macro, or identifier ID, plus a 32-bit integer for the submodule ID (this field is set to all ones to indicate a decl vs. a macro). An additional in-memory bool distinguishes pointer nodes from ID nodes. Advantages:

  • The main ID is now 64 bits wide, accommodating recent changes in clang.
  • We’re no longer stealing bits from clang (we do steal the max value of the submodule ID, though).
  • There’s no on-disk bit that, when set, will cause an ID to be interpreted as a pointer.
  • Design is robust against clang::serialization::SubmoduleID also becoming 64-bit (although this will waste space).

This will require a matching clang PR to revert the revert of the ID change: swiftlang/llvm-project#9017

Fixes rdar://131134424.

Several serialization IDs that used to be 32 bits are being widened to 64. Modify SwiftLookupTable and its supporting types to accommodate this.

The new design uses a 64-bit integer for the pointer, decl, macro, or identifier ID, plus a 32-bit integer for the submodule ID (this field is set to all ones to indicate a decl vs. a macro). An additional in-memory bool distinguishes pointer nodes from ID nodes. Advantages:

• The main ID is now 64 bits wide, accommodating recent changes in clang.
• We’re no longer stealing bits from clang (we *do* steal the max value of the submodule ID, though).
• There’s no on-disk bit that, when set, will cause an ID to be interpreted as a pointer.
• Design is robust against `clang::serialization::SubmoduleID` also becoming 64-bit (although this will waste space).

Fixes rdar://131134424.
@beccadax
Copy link
Contributor Author

With swiftlang/llvm-project#9017

@swift-ci please test

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