Commit 9bffcf38 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: minor cleanup in sinit.go

Passes toolstash -cmp.

Change-Id: Id16009ef3ef1173eafe0f0c578dbf325b61aab3c
Reviewed-on: https://go-review.googlesource.com/20674
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarDave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 0d2e92c2
...@@ -512,28 +512,11 @@ func staticname(t *Type, ctxt int) *Node { ...@@ -512,28 +512,11 @@ func staticname(t *Type, ctxt int) *Node {
func isliteral(n *Node) bool { func isliteral(n *Node) bool {
// Treat nils as zeros rather than literals. // Treat nils as zeros rather than literals.
if n.Op == OLITERAL { return n.Op == OLITERAL && n.Val().Ctype() != CTNIL
if n.Val().Ctype() != CTNIL {
return true
}
}
return false
} }
func simplename(n *Node) bool { func simplename(n *Node) bool {
if n.Op != ONAME { return n.Op == ONAME && n.Addable && n.Class&PHEAP == 0 && n.Class != PPARAMREF
return false
}
if !n.Addable {
return false
}
if n.Class&PHEAP != 0 {
return false
}
if n.Class == PPARAMREF {
return false
}
return true
} }
func litas(l *Node, r *Node, init *Nodes) { func litas(l *Node, r *Node, init *Nodes) {
...@@ -1442,22 +1425,11 @@ func gen_as_init(n *Node, reportOnly bool) bool { ...@@ -1442,22 +1425,11 @@ func gen_as_init(n *Node, reportOnly bool) bool {
default: default:
goto no goto no
case TBOOL, case TBOOL, TINT8, TUINT8, TINT16, TUINT16,
TINT8, TINT32, TUINT32, TINT64, TUINT64,
TUINT8, TINT, TUINT, TUINTPTR,
TINT16, TPTR32, TPTR64,
TUINT16, TFLOAT32, TFLOAT64:
TINT32,
TUINT32,
TINT64,
TUINT64,
TINT,
TUINT,
TUINTPTR,
TPTR32,
TPTR64,
TFLOAT32,
TFLOAT64:
if !reportOnly { if !reportOnly {
gdata(&nam, nr, int(nr.Type.Width)) gdata(&nam, nr, int(nr.Type.Width))
} }
......
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