mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Unavailable enum elements cannot be instantiated at runtime without invoking UB. Therefore the optimizer can consider a basic block unreachable if its only predecessor is a block that terminates in a switch instruction matching an unavailable enum element. Furthermore, removing the switch instruction cases that refer to unavailable enum elements is _mandatory_ when `-unavailable-decl-optimization=complete` is specified because otherwise lowered IR for these instructions could refer to enum tag accessors that will not be lowered, resulting in a failure during linking. Resolves rdar://113872720.
13 KiB
13 KiB