]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: make ir.Func the ODCLFUNC Node implementation
authorRuss Cox <rsc@golang.org>
Sat, 28 Nov 2020 12:23:50 +0000 (07:23 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 18:34:00 +0000 (18:34 +0000)
commitc4bd0b7474f169a60acf66306a4a721f790e36c9
tree3328a4c75a2ba9f7c1f98888e4f45da154ccd795
parent65ae15ac5d43ad82f664e5a914d74c7549568c93
[dev.regabi] cmd/compile: make ir.Func the ODCLFUNC Node implementation

Before this CL, an ODCLFUNC Node was represented by both
a node struct and a Func struct (and a Name for the ONAME,
which isn't changing here). Now Func can be repurposed as
the ODCLFUNC implementation, replacing the two structs
totaling 280+144 = 424 bytes (64-bit) with a single 320-byte struct.

Using the *Func as the node also gives us a clear, typed answer to
“which node should we use to represent functions?”
The next CL will clean up uses. This CL is just the trivial
change in representation.

Passes buildall w/ toolstash -cmp.

Change-Id: Ie6d670da91d6eb8d67a85f8f83630b9586dc7443
Reviewed-on: https://go-review.googlesource.com/c/go/+/274096
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/sizeof_test.go