]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: simplify ir.Func somewhat
authorMatthew Dempsky <mdempsky@google.com>
Tue, 29 Dec 2020 11:08:23 +0000 (03:08 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 29 Dec 2020 11:54:34 +0000 (11:54 +0000)
commit9ea272e5ec5dd5eadd59d54c08377d5d9527a51b
tree6ab3da803e9512450333a86738a5b98246bb70b9
parente40cb4d4ae357d80d5e2b66e765c937317fad07f
[dev.regabi] cmd/compile: simplify ir.Func somewhat

Two simplifications:

1. Statements (including ODCLFUNC) don't have types, and the
Func.Nname already has a type. There's no need for a second one.
However, there is a lot of code that expects to be able to call
Func.Type, so leave a forwarding method, like with Sym and Linksym.

2. Inline and remove ir.NewFuncNameAt. It doesn't really save any
code, and it's only used a handful of places.

Passes toolstash -cmp.

Change-Id: I51acaa341897dae0fcdf2fa576a10174a2ae4d1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/280648
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/sizeof_test.go
src/cmd/compile/internal/noder/noder.go
src/cmd/compile/internal/typecheck/dcl.go
src/cmd/compile/internal/typecheck/export.go
src/cmd/compile/internal/typecheck/func.go
src/cmd/compile/internal/typecheck/iimport.go
src/cmd/compile/internal/walk/closure.go