Commit 515bb012 authored by LE Manh Cuong's avatar LE Manh Cuong Committed by Matthew Dempsky

cmd/compile: remove isfat from order expr

isfat was removed in walkexpr in CL 32313. For consistency,
remove it from order expr, too.

Change-Id: I0a47e0da13ba0168d6a055d990b8efad26ad790d
Reviewed-on: https://go-review.googlesource.com/c/go/+/179057
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 52cff701
......@@ -306,18 +306,6 @@ func ggloblsym(s *obj.LSym, width int32, flags int16) {
Ctxt.Globl(s, int64(width), int(flags))
}
func isfat(t *types.Type) bool {
if t != nil {
switch t.Etype {
case TSTRUCT, TARRAY, TSLICE, TSTRING,
TINTER: // maybe remove later
return true
}
}
return false
}
func Addrconst(a *obj.Addr, v int64) {
a.Sym = nil
a.Type = obj.TYPE_CONST
......
......@@ -1028,7 +1028,6 @@ func (o *Order) expr(n, lhs *Node) *Node {
}
}
// key must be addressable
case OINDEXMAP:
n.Left = o.expr(n.Left, nil)
n.Right = o.expr(n.Right, nil)
......@@ -1048,6 +1047,7 @@ func (o *Order) expr(n, lhs *Node) *Node {
}
}
// key must be addressable
n.Right = o.mapKeyTemp(n.Left.Type, n.Right)
if needCopy {
n = o.copyExpr(n, n.Type, false)
......@@ -1205,10 +1205,7 @@ func (o *Order) expr(n, lhs *Node) *Node {
case ODOTTYPE, ODOTTYPE2:
n.Left = o.expr(n.Left, nil)
// TODO(rsc): The isfat is for consistency with componentgen and walkexpr.
// It needs to be removed in all three places.
// That would allow inlining x.(struct{*int}) the same as x.(*int).
if !isdirectiface(n.Type) || isfat(n.Type) || instrumenting {
if !isdirectiface(n.Type) || instrumenting {
n = o.copyExpr(n, n.Type, true)
}
......
......@@ -1449,3 +1449,15 @@ func liveness(e *ssafn, f *ssa.Func, pp *Progs) LivenessMap {
return lv.livenessMap
}
func isfat(t *types.Type) bool {
if t != nil {
switch t.Etype {
case TSTRUCT, TARRAY, TSLICE, TSTRING,
TINTER: // maybe remove later
return true
}
}
return false
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment