cmd/compile: use Node.Int more

Generated by eg.

Passes toolstash -cmp.

Change-Id: I7516c211ca9aacf824f74894671dc62d31763b01
Reviewed-on: https://go-review.googlesource.com/21422
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2016-03-31 14:54:46 -07:00
parent 3a0783c504
commit e504055e78
8 changed files with 46 additions and 46 deletions

View file

@ -433,7 +433,7 @@ func staticassign(l *Node, r *Node, out *[]*Node) bool {
initplan(r)
if r.Type.IsSlice() {
// Init slice.
bound := r.Right.Val().U.(*Mpint).Int64()
bound := r.Right.Int()
ta := typArray(r.Type.Elem(), bound)
a := staticname(ta, 1)
inittemps[r] = a
@ -690,7 +690,7 @@ func arraylit(ctxt int, pass int, n *Node, var_ *Node, init *Nodes) {
func slicelit(ctxt int, n *Node, var_ *Node, init *Nodes) {
// make an array type
t := n.Type.Copy()
t.Bound = n.Right.Val().U.(*Mpint).Int64()
t.Bound = n.Right.Int()
t.Width = 0
t.Sym = nil
t.Haspointers = 0
@ -1175,7 +1175,7 @@ func oaslit(n *Node, init *Nodes) bool {
func getlit(lit *Node) int {
if Smallintconst(lit) {
return int(lit.Val().U.(*Mpint).Int64())
return int(lit.Int())
}
return -1
}
@ -1238,7 +1238,7 @@ func initplan(n *Node) {
if a.Op != OKEY || !Smallintconst(a.Left) {
Fatalf("initplan arraylit")
}
addvalue(p, n.Type.Elem().Width*a.Left.Val().U.(*Mpint).Int64(), a.Right)
addvalue(p, n.Type.Elem().Width*a.Left.Int(), a.Right)
}
case OSTRUCTLIT: