Commits
Chris Lattner committed e87b611fc31
Change silgen to lower non-inout-self arguments as simple values, instead of
allocating a box for them. When self is not marked inout (which will be
the default for structs someday) it changes the codegen of:
struct Foo {
...
func testfunction() -> Foo {
return self
}
}
To:
sil @_TV1t3Foo12testfunctionfS0_FT_S0_ : $@cc(method) @thin (Foo) -> Foo {
bb0(%0 : $Foo):
%1 = tuple ()
return %0 : $Foo // id: %2
}
instead of allocating a box, doing a store to it, etc.
Also included: don't maintain references into VarLoc where a simple copy
of the element would suffice. This isn't important, but was part of my
silvtable debugging and seems like the right thing.
Swift SVN r11307