swift icon indicating copy to clipboard operation
swift copied to clipboard

Accommodate 64-bit clang serialization IDs

Open beccadax opened this issue 7 months ago • 1 comments

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: https://github.com/swiftlang/llvm-project/pull/9017

Fixes rdar://131134424.

beccadax avatar Jul 26 '24 21:07 beccadax