Commits

Chris Lattner committed 6d84785e52b
Substantially rework how weak pointers are represented in the AST and at the SIL level. Now, the referent type of a WeakStorageType is always an optional type, instead of always being the underlying reference. This allows us to represent both optional types. Before, both of these had the same AST representation of WeakStorageType(T): weak var x : T? weak var x : T! which doesn't work. Now we represent the optional type explicitly in the AST and at SIL level. This also significantly simplifies a bunch of code that was ripping off the optional type and resynthesizing it in other places, and makes SILGen of weak pointers much more straight-forward by eliminating the need for emitRefToOptional and emitOptionalToRef entirely (see the diffs in test/SILGen/weak). Weak pointers still have problems, but this is a big step forward. Swift SVN r18312