Commits

Joe Groff committed d69eb660a61
SILGen: Emit shadow copies of byref arguments. Create a local box for byref arguments that can be closed over. The box receives the value of the byref at function entry, and the value in the box at function exit is written back to the byref. This will allow us to eliminate the no-capture restriction on byrefs, allowing them to be used in auto closures and other HOFs, and doing the right thing in the 99% case where closures are effectively nocapture without requiring user annotation. <rdar://problem/14732389> There are a couple of loose ends: - The type-checker can lose its restriction on byref captures. I'll do that next. - Debug info needs to learn how to represent local byref boxes. Adrian is better qualified to decide how to do that. - Byref shadow copies completely defeat the copy-on-write optimization for String, making append sequences ridiculously slow. Memory promotion needs to learn to eliminate shadow copies completely when it promotes away byref boxes in order to solve this regression. Swift SVN r8630