mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
NOTE: I changed all places that the CastOptimizer is created to just pass in nullptr for now so this is NFC. ---- Right now the interface of the CastOptimizer is muddled and confused. Sometimes it is returning a value that should be used by the caller, other times it is returning an instruction that is meant to be reprocessed by the caller. This series of patches is attempting to clean this up by switching to the following model: 1. If we are optimizing a cast of a value, we return a SILValue. If the cast fails, we return an empty SILValue(). 2. If we are optimizing a cast of an address, we return a boolean value to show success/failure and require the user to use the SILBuilderContext to get the cast if they need to.
2.1 KiB
2.1 KiB