aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2017-03-11 17:17:15 -0800
committerMatthew Dempsky <mdempsky@google.com>2017-03-20 23:49:29 +0000
commit7bb5b2d33a522d80e35f93f4c7bd6471d1d73552 (patch)
tree2fb9ca37775ce5b10b3a34ca922a8ec127330d5d
parentcce4c319d6aa2fbcf16fbab6a3dc74baf482ce51 (diff)
downloadgo-7bb5b2d33a522d80e35f93f4c7bd6471d1d73552.tar.xz
cmd/internal/obj: remove unneeded Addr.Node and Prog.Opt fields
Change-Id: I218b241c32a5948b66ad0d95ecc368648cf4ddf5 Reviewed-on: https://go-review.googlesource.com/38130 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-rw-r--r--src/cmd/compile/internal/gc/gsubr.go1
-rw-r--r--src/cmd/compile/internal/gc/ssa.go4
-rw-r--r--src/cmd/internal/obj/link.go47
-rw-r--r--src/cmd/internal/obj/sizeof_test.go4
4 files changed, 24 insertions, 32 deletions
diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go
index 3f3e23ed3d..c895117390 100644
--- a/src/cmd/compile/internal/gc/gsubr.go
+++ b/src/cmd/compile/internal/gc/gsubr.go
@@ -124,7 +124,6 @@ func Naddr(a *obj.Addr, n *Node) {
a.Offset = n.Xoffset
s := n.Sym
- a.Node = n.Orig
if s == nil {
Fatalf("naddr: nil sym %v", n)
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 2bddfca37d..87a84285b6 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -4472,13 +4472,11 @@ func AddAux2(a *obj.Addr, v *ssa.Value, offset int64) {
case *ssa.ArgSymbol:
n := sym.Node.(*Node)
a.Name = obj.NAME_PARAM
- a.Node = n
a.Sym = Linksym(n.Orig.Sym)
a.Offset += n.Xoffset
case *ssa.AutoSymbol:
n := sym.Node.(*Node)
a.Name = obj.NAME_AUTO
- a.Node = n
a.Sym = Linksym(n.Sym)
a.Offset += n.Xoffset
default:
@@ -4581,7 +4579,6 @@ func AutoVar(v *ssa.Value) (*Node, int64) {
func AddrAuto(a *obj.Addr, v *ssa.Value) {
n, off := AutoVar(v)
a.Type = obj.TYPE_MEM
- a.Node = n
a.Sym = Linksym(n.Sym)
a.Reg = int16(thearch.REGSP)
a.Offset = n.Xoffset + off
@@ -4598,7 +4595,6 @@ func (s *SSAGenState) AddrScratch(a *obj.Addr) {
}
a.Type = obj.TYPE_MEM
a.Name = obj.NAME_AUTO
- a.Node = s.ScratchFpMem
a.Sym = Linksym(s.ScratchFpMem.Sym)
a.Reg = int16(thearch.REGSP)
a.Offset = s.ScratchFpMem.Xoffset
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go
index bb71925b52..d397dec679 100644
--- a/src/cmd/internal/obj/link.go
+++ b/src/cmd/internal/obj/link.go
@@ -169,8 +169,6 @@ type Addr struct {
// for TYPE_BRANCH, a *Prog (optional)
// for TYPE_TEXTSIZE, an int32 (optional)
Val interface{}
-
- Node interface{} // for use by compiler
}
type AddrName int8
@@ -231,29 +229,28 @@ const (
// The other fields not yet mentioned are for use by the back ends and should
// be left zeroed by creators of Prog lists.
type Prog struct {
- Ctxt *Link // linker context
- Link *Prog // next Prog in linked list
- From Addr // first source operand
- From3 *Addr // third source operand (second is Reg below)
- To Addr // destination operand (second is RegTo2 below)
- Pcond *Prog // target of conditional jump
- Opt interface{} // available to optimization passes to hold per-Prog state
- Forwd *Prog // for x86 back end
- Rel *Prog // for x86, arm back ends
- Pc int64 // for back ends or assembler: virtual or actual program counter, depending on phase
- Pos src.XPos // source position of this instruction
- Spadj int32 // effect of instruction on stack pointer (increment or decrement amount)
- As As // assembler opcode
- Reg int16 // 2nd source operand
- RegTo2 int16 // 2nd destination operand
- Mark uint16 // bitmask of arch-specific items
- Optab uint16 // arch-specific opcode index
- Scond uint8 // condition bits for conditional instruction (e.g., on ARM)
- Back uint8 // for x86 back end: backwards branch state
- Ft uint8 // for x86 back end: type index of Prog.From
- Tt uint8 // for x86 back end: type index of Prog.To
- Isize uint8 // for x86 back end: size of the instruction in bytes
- Mode int8 // for x86 back end: 32- or 64-bit mode
+ Ctxt *Link // linker context
+ Link *Prog // next Prog in linked list
+ From Addr // first source operand
+ From3 *Addr // third source operand (second is Reg below)
+ To Addr // destination operand (second is RegTo2 below)
+ Pcond *Prog // target of conditional jump
+ Forwd *Prog // for x86 back end
+ Rel *Prog // for x86, arm back ends
+ Pc int64 // for back ends or assembler: virtual or actual program counter, depending on phase
+ Pos src.XPos // source position of this instruction
+ Spadj int32 // effect of instruction on stack pointer (increment or decrement amount)
+ As As // assembler opcode
+ Reg int16 // 2nd source operand
+ RegTo2 int16 // 2nd destination operand
+ Mark uint16 // bitmask of arch-specific items
+ Optab uint16 // arch-specific opcode index
+ Scond uint8 // condition bits for conditional instruction (e.g., on ARM)
+ Back uint8 // for x86 back end: backwards branch state
+ Ft uint8 // for x86 back end: type index of Prog.From
+ Tt uint8 // for x86 back end: type index of Prog.To
+ Isize uint8 // for x86 back end: size of the instruction in bytes
+ Mode int8 // for x86 back end: 32- or 64-bit mode
}
// From3Type returns From3.Type, or TYPE_NONE when From3 is nil.
diff --git a/src/cmd/internal/obj/sizeof_test.go b/src/cmd/internal/obj/sizeof_test.go
index 5d5a710290..bc28fea346 100644
--- a/src/cmd/internal/obj/sizeof_test.go
+++ b/src/cmd/internal/obj/sizeof_test.go
@@ -22,9 +22,9 @@ func TestSizeof(t *testing.T) {
_32bit uintptr // size on 32bit platforms
_64bit uintptr // size on 64bit platforms
}{
- {Addr{}, 40, 64},
+ {Addr{}, 32, 48},
{LSym{}, 60, 104},
- {Prog{}, 148, 232},
+ {Prog{}, 124, 184},
}
for _, tt := range tests {