mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: replace Addr.U struct {...} with Val interface{}
An interface{} is more in the spirit of the original union.
By my calculations, on 64-bit systems this reduces
Addr from 120 to 80 bytes, and Prog from 592 to 424 bytes.
Change-Id: I0d7b0981513c2a3c94c9ac76bb4f8816485b5a3c
Reviewed-on: https://go-review.googlesource.com/7744
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
631d6a33bf
commit
532ccae154
33 changed files with 164 additions and 164 deletions
|
|
@ -114,8 +114,8 @@ func removevardef(firstp *obj.Prog) {
|
|||
p.Link = p.Link.Link
|
||||
}
|
||||
if p.To.Type == obj.TYPE_BRANCH {
|
||||
for p.To.U.Branch != nil && (p.To.U.Branch.As == obj.AVARDEF || p.To.U.Branch.As == obj.AVARKILL) {
|
||||
p.To.U.Branch = p.To.U.Branch.Link
|
||||
for p.To.Val.(*obj.Prog) != nil && (p.To.Val.(*obj.Prog).As == obj.AVARDEF || p.To.Val.(*obj.Prog).As == obj.AVARKILL) {
|
||||
p.To.Val = p.To.Val.(*obj.Prog).Link
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue