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
}
}
- // key must be addressable
case OINDEXMAP:
n.Left = o.expr(n.Left, nil)
n.Right = o.expr(n.Right, nil)
}
}
+ // key must be addressable
n.Right = o.mapKeyTemp(n.Left.Type, n.Right)
if needCopy {
n = o.copyExpr(n, n.Type, false)
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)
}
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
+}