]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: simplify ~r/~b naming
authorMatthew Dempsky <mdempsky@google.com>
Wed, 26 May 2021 20:54:31 +0000 (13:54 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 26 May 2021 23:50:32 +0000 (23:50 +0000)
commite99e9a6e0147592b12175a19a2a9dafe96a984f9
tree0f46c545036f9ec5ccff9d38a8272c2e440b9cb4
parent4c68edd1feaad43e098dd7375d6c1cfc43243211
[dev.typeparams] cmd/compile: simplify ~r/~b naming

The compiler renames anonymous and blank result parameters to ~rN or
~bN, but the current semantics for computing N are rather annoying and
difficult to reproduce cleanly. They also lead to difficult to read
escape analysis results in tests.

This CL changes N to always be calculated as the parameter's index
within the function's result parameter tuple. E.g., if a function has
a single result, it will now always be named "~r0".

The normative change to this CL is fairly simple, but it requires
updating a lot of test expectations.

Change-Id: I58a3c94de00cb822cb94efe52d115531193c993c
Reviewed-on: https://go-review.googlesource.com/c/go/+/323010
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
17 files changed:
src/cmd/compile/internal/logopt/logopt_test.go
src/cmd/compile/internal/noder/object.go
src/cmd/compile/internal/typecheck/dcl.go
test/escape2.go
test/escape2n.go
test/escape5.go
test/escape_array.go
test/escape_calls.go
test/escape_closure.go
test/escape_param.go
test/escape_runtime_atomic.go
test/escape_slice.go
test/escape_struct_return.go
test/escape_unsafe.go
test/fixedbugs/issue12006.go
test/fixedbugs/issue12588.go
test/fixedbugs/issue42284.dir/a.go