compiler: do not introduce excessive locals on inline

When function call-site parameter is an identifier,
we may load it directly. Currently it can be also modified,
this will be fixed in a separate commit.
This commit is contained in:
Evgeniy Stratonikov 2021-02-04 16:26:33 +03:00
parent 1ae0d022dd
commit 27e60455c7
3 changed files with 32 additions and 12 deletions

View file

@ -111,12 +111,7 @@ func TestInlineConversion(t *testing.T) {
a := 2
{
b := 1
c := a
{
bb := b
cc := c
return (bb + cc) * (b + c)
}
return (b + a) * (b + a)
}
}`
b2, err := compiler.Compile("foo.go", strings.NewReader(src2))