Commits

Chris Lattner committed f99492202fe
Make some fairly major internal changes to our value system: now, get-only properties are represented as rvalues, not non-mutable lvalues. As part of this, isReferencedAsLValue() only returns true for mutable VarDecls. This required some pretty serious rearrangement and refactoring of code, because now (among other things) get-only properties can be emitted as rvalues, so the rvalue machinery needs to be able to produce getter calls. This is an important step towards getting proper value semantics going (for 'let's etc) and also allows us to materialize addresses less often. As a simple example, before we would silgen this: struct S { var i : Int } var P : S { get: ... } func f() { print(P.i) } into: %2 = function_ref @_TF1tg1PVS_1S : $@thin () -> S // user: %3 %3 = apply %2() : $@thin () -> S // user: %5 %4 = alloc_stack $S // users: %9, %6, %5 store %3 to %4#1 : $*S // id: %5 %6 = struct_element_addr %4#1 : $*S, #i // user: %7 %7 = load %6 : $*Int64 // user: %8 now we generate: %2 = function_ref @_TF1tg1PVS_1S : $@thin () -> S // user: %3 %3 = apply %2() : $@thin () -> S // user: %4 %4 = struct_extract %3 : $S, #i // user: %5 Swift SVN r11632