This is necessary to be able to properly stash values with nontrivial lowerings, such as metatypes and functions, inside existential containers. Modify SILGen to lower values to the proper abstraction level before storing them in an existential container. Part of the fix for rdar://problem/18189508, though runtime problems still remain when trying to actually dynamicCast out a metatype from an Any container.
Swift SVN r21830
This reverts commit r21567.
The reason I wanted to do this is that I thought it would be easier for other
people to scan for matching retains, releases. I am pretty fast at such scanning
given I have had a little practice at doing so ; ), but I have noticed that for
other people it takes longer. I was hoping that canonicalizing retain_value,
release_value to be on what the ARC optimizer considers to be the “root” of the
allocation would make that easier. Now that I think about it though:
1. The value is dubious since it won’t help us to optimize programs any better.
2. It could actually hurt optimization by getting in the way of SROA and friends
by creating uses on larger structs.
Given that it /might/ hurt optimization, I am just going to revert this. There
is no point in taking such a risk.
Swift SVN r21596