Commits

Chris Lattner committed 2fd563616e3
improve SILGen of RebindSelfInConstructorExpr in several ways: - In the normal optional-to-optional init case, use "emitUncheckedGetOptionalValueFrom" instead of "emitCheckedGetOptionalValueFrom" since we have already checked to see if the optional is present. This avoids a function call (that is mandatory inlined away) along with a ton of SIL that gets mandatory inlined in that shows an assertion failure that can never fail. - Teach SGF::emitDoesOptionalHaveValue and SILGenFunction::emitUncheckedGetOptionalValueFrom to work with optionals in memory and optional values. - Based on this, stop dropping the optional self into a materialized temporary all the time. Just use whatever we have (a value or the address of an address-only thing) and operate on it directly. - Use Cleanups.emitBlockForCleanups instead of emitting a block and using emitBranchAndCleanups. This leads to cleaner code in SILGen and avoids emitting a dead block in the common case where there are no cleanups to perform. Overall, these changes lead to better super.init calls in failable inits, and more importantly enable understanding the output of -emit-sil on them :-) Swift SVN r27477