mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Specifically, copyAndExtendForLifetimeEndingRAUW -> createPlusOneCopy(value, oldConsumingUse) copyAndExtendForNonLifetimeEndingRAUW -> createPlusZeroCopy(value, nonLifetimeEndingUses) copyBorrowAndExtendForRAUW -> createPlusZeroBorrow(value, nonLifetimeEndingUses) Beyond being shorter, the PlusOne vs PlusZero mnemonic is telling the caller whether or not the caller is responsible for cleaning up the returned copy_value. In the PlusZero cases, we assume that all uses are non-lifetime ending and we need to insert all destroy_value at the liveness points of the value. In the PlusOne case in contrast, we are supposed to make a copy of value and the complete oldConsumingUse's block into a joint post-dominance set of blocks. Then we insert destroy_values for our new copy into the completion blocks that we found and leave cleaning up value along paths through oldConsumingUse to our user. In this sense the value is a PlusOne value that our user must clean up for us (sorta makes me think about ManagedValue).