mirror of
https://github.com/apple/swift.git
synced 2026-10-24 20:15:56 +02:00
Enable SILGen, SIL verification, and AddressLowering of `keypath` instructions under -enable-sil-opaque-values. Existing keypath SIL-optimizer tests are extended to exercise the opaque-values pipeline. In opaque-values mode, TypeLowering::handleAddressOnly lowers address-only AST types as objects until AddressLowering runs, so getLoweredType returns the object form for address-only KeyPath index parameters. The keypath runtime ABI requires the address form, and KeyPathPatternComponent caches its lowered index type — AddressLowering does not reconstruct the pattern with refreshed lowerings. Bypass TypeLowering in lowerKeyPathMemberIndexTypes with the static SILType::isAddressOnly (which reads SILTypeProperties directly, skipping handleAddressOnly's opaque-values override) and switch address-only index lowerings to address form during pattern construction. A cleaner fix would either drop the cached lowering from KeyPathPatternComponent::Index, or have AddressLowering rebuild the keypath pattern with refreshed lowerings — both larger refactors, deferred for now.
742 B
742 B