]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove isfat from order expr
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>
Mon, 27 May 2019 08:58:24 +0000 (15:58 +0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 28 Aug 2019 19:47:04 +0000 (19:47 +0000)
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: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/plive.go

index 51c0fffc9ee3a3acac95aca8645a864007eab375..1e15a67bbd6d19d5168e081bd93e9c4f3690dbdb 100644 (file)
@@ -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
index 15850d72a19a41c9462223438ba66ff3da8c7436..0ea43f114e27f90eb2aed481cf75f642b971391f 100644 (file)
@@ -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)
                }
 
index a9a01e5c1291e8d5b58b03a23332246d4661fec4..7d3377f40c14786e05695709f7a61130fee2bf77 100644 (file)
@@ -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
+}