From ddc93398b955a4d71683c8019d87d2ff9c739070 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 14 May 2015 19:50:41 -0700 Subject: [PATCH] cmd/6g, cmd/internal/gc: use Etype instead of Ostk Change-Id: Ifda5d84b28717986c93b63767298180a6d6236c0 Reviewed-on: https://go-review.googlesource.com/10140 Reviewed-by: Russ Cox --- src/cmd/6g/ggen.go | 6 +++--- src/cmd/internal/gc/syntax.go | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cmd/6g/ggen.go b/src/cmd/6g/ggen.go index 7282ac53e0039..e0e1b8a4df8bb 100644 --- a/src/cmd/6g/ggen.go +++ b/src/cmd/6g/ggen.go @@ -306,7 +306,7 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) { * known to be dead. */ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) { - r := int(reg[dr]) + r := reg[dr] // save current ax and dx if they are live // and not the destination @@ -318,7 +318,7 @@ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) { x.Type = gc.Types[gc.TINT64] gmove(x, oldx) x.Type = t - oldx.Ostk = int32(r) // squirrel away old r value + oldx.Etype = r // squirrel away old r value reg[dr] = 1 } } @@ -326,7 +326,7 @@ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) { func restx(x *gc.Node, oldx *gc.Node) { if oldx.Op != 0 { x.Type = gc.Types[gc.TINT64] - reg[x.Reg] = uint8(oldx.Ostk) + reg[x.Reg] = oldx.Etype gmove(oldx, x) gc.Regfree(oldx) } diff --git a/src/cmd/internal/gc/syntax.go b/src/cmd/internal/gc/syntax.go index 50de7f74de628..d4ede60c900ad 100644 --- a/src/cmd/internal/gc/syntax.go +++ b/src/cmd/internal/gc/syntax.go @@ -27,7 +27,7 @@ type Node struct { Nointerface bool Ullman uint8 // sethi/ullman number Addable bool // addressable - Etype uint8 // op for OASOP, etype for OTYPE, exclam for export + Etype uint8 // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg Bounded bool // bounds check unnecessary Class uint8 // PPARAM, PAUTO, PEXTERN, etc Embedded uint8 // ODCLFIELD embedded type @@ -97,7 +97,6 @@ type Node struct { Lineno int32 Xoffset int64 Stkdelta int64 // offset added by stack frame compaction phase. - Ostk int32 // 6g only Iota int32 Walkgen uint32 Esclevel Level