Commit 71c9454f authored by Daniel Martí's avatar Daniel Martí

cmd/compile: remove some redundant types in decls

As per golint's suggestions.

Change-Id: Ie0c6ad9aa5dc69966a279562a341c7b095c47ede
Reviewed-on: https://go-review.googlesource.com/64192
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent de25b12d
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
"cmd/internal/src" "cmd/internal/src"
) )
var sharedProgArray *[10000]obj.Prog = new([10000]obj.Prog) // *T instead of T to work around issue 19839 var sharedProgArray = new([10000]obj.Prog) // *T instead of T to work around issue 19839
// Progs accumulates Progs for a function and converts them into machine code. // Progs accumulates Progs for a function and converts them into machine code.
type Progs struct { type Progs struct {
......
...@@ -3775,7 +3775,7 @@ type u642fcvtTab struct { ...@@ -3775,7 +3775,7 @@ type u642fcvtTab struct {
one func(*state, *types.Type, int64) *ssa.Value one func(*state, *types.Type, int64) *ssa.Value
} }
var u64_f64 u642fcvtTab = u642fcvtTab{ var u64_f64 = u642fcvtTab{
geq: ssa.OpGeq64, geq: ssa.OpGeq64,
cvt2F: ssa.OpCvt64to64F, cvt2F: ssa.OpCvt64to64F,
and: ssa.OpAnd64, and: ssa.OpAnd64,
...@@ -3785,7 +3785,7 @@ var u64_f64 u642fcvtTab = u642fcvtTab{ ...@@ -3785,7 +3785,7 @@ var u64_f64 u642fcvtTab = u642fcvtTab{
one: (*state).constInt64, one: (*state).constInt64,
} }
var u64_f32 u642fcvtTab = u642fcvtTab{ var u64_f32 = u642fcvtTab{
geq: ssa.OpGeq64, geq: ssa.OpGeq64,
cvt2F: ssa.OpCvt64to32F, cvt2F: ssa.OpCvt64to32F,
and: ssa.OpAnd64, and: ssa.OpAnd64,
...@@ -3866,12 +3866,12 @@ type u322fcvtTab struct { ...@@ -3866,12 +3866,12 @@ type u322fcvtTab struct {
cvtI2F, cvtF2F ssa.Op cvtI2F, cvtF2F ssa.Op
} }
var u32_f64 u322fcvtTab = u322fcvtTab{ var u32_f64 = u322fcvtTab{
cvtI2F: ssa.OpCvt32to64F, cvtI2F: ssa.OpCvt32to64F,
cvtF2F: ssa.OpCopy, cvtF2F: ssa.OpCopy,
} }
var u32_f32 u322fcvtTab = u322fcvtTab{ var u32_f32 = u322fcvtTab{
cvtI2F: ssa.OpCvt32to32F, cvtI2F: ssa.OpCvt32to32F,
cvtF2F: ssa.OpCvt64Fto32F, cvtF2F: ssa.OpCvt64Fto32F,
} }
...@@ -3980,7 +3980,7 @@ type f2uCvtTab struct { ...@@ -3980,7 +3980,7 @@ type f2uCvtTab struct {
cutoff uint64 cutoff uint64
} }
var f32_u64 f2uCvtTab = f2uCvtTab{ var f32_u64 = f2uCvtTab{
ltf: ssa.OpLess32F, ltf: ssa.OpLess32F,
cvt2U: ssa.OpCvt32Fto64, cvt2U: ssa.OpCvt32Fto64,
subf: ssa.OpSub32F, subf: ssa.OpSub32F,
...@@ -3990,7 +3990,7 @@ var f32_u64 f2uCvtTab = f2uCvtTab{ ...@@ -3990,7 +3990,7 @@ var f32_u64 f2uCvtTab = f2uCvtTab{
cutoff: 9223372036854775808, cutoff: 9223372036854775808,
} }
var f64_u64 f2uCvtTab = f2uCvtTab{ var f64_u64 = f2uCvtTab{
ltf: ssa.OpLess64F, ltf: ssa.OpLess64F,
cvt2U: ssa.OpCvt64Fto64, cvt2U: ssa.OpCvt64Fto64,
subf: ssa.OpSub64F, subf: ssa.OpSub64F,
...@@ -4000,7 +4000,7 @@ var f64_u64 f2uCvtTab = f2uCvtTab{ ...@@ -4000,7 +4000,7 @@ var f64_u64 f2uCvtTab = f2uCvtTab{
cutoff: 9223372036854775808, cutoff: 9223372036854775808,
} }
var f32_u32 f2uCvtTab = f2uCvtTab{ var f32_u32 = f2uCvtTab{
ltf: ssa.OpLess32F, ltf: ssa.OpLess32F,
cvt2U: ssa.OpCvt32Fto32, cvt2U: ssa.OpCvt32Fto32,
subf: ssa.OpSub32F, subf: ssa.OpSub32F,
...@@ -4010,7 +4010,7 @@ var f32_u32 f2uCvtTab = f2uCvtTab{ ...@@ -4010,7 +4010,7 @@ var f32_u32 f2uCvtTab = f2uCvtTab{
cutoff: 2147483648, cutoff: 2147483648,
} }
var f64_u32 f2uCvtTab = f2uCvtTab{ var f64_u32 = f2uCvtTab{
ltf: ssa.OpLess64F, ltf: ssa.OpLess64F,
cvt2U: ssa.OpCvt64Fto32, cvt2U: ssa.OpCvt64Fto32,
subf: ssa.OpSub64F, subf: ssa.OpSub64F,
......
...@@ -612,7 +612,7 @@ func typecheck1(n *Node, top int) *Node { ...@@ -612,7 +612,7 @@ func typecheck1(n *Node, top int) *Node {
if et == TIDEAL { if et == TIDEAL {
et = TINT et = TINT
} }
var aop Op = OXXX aop := OXXX
if iscmp[n.Op] && t.Etype != TIDEAL && !eqtype(l.Type, r.Type) { if iscmp[n.Op] && t.Etype != TIDEAL && !eqtype(l.Type, r.Type) {
// comparison is okay as long as one side is // comparison is okay as long as one side is
// assignable to the other. convert so they have // assignable to the other. convert so they have
......
...@@ -2869,10 +2869,10 @@ func mkmapnames(base string) mapnames { ...@@ -2869,10 +2869,10 @@ func mkmapnames(base string) mapnames {
return mapnames{base, base + "_fast32", base + "_fast64", base + "_faststr"} return mapnames{base, base + "_fast32", base + "_fast64", base + "_faststr"}
} }
var mapaccess1 mapnames = mkmapnames("mapaccess1") var mapaccess1 = mkmapnames("mapaccess1")
var mapaccess2 mapnames = mkmapnames("mapaccess2") var mapaccess2 = mkmapnames("mapaccess2")
var mapassign mapnames = mkmapnames("mapassign") var mapassign = mkmapnames("mapassign")
var mapdelete mapnames = mkmapnames("mapdelete") var mapdelete = mkmapnames("mapdelete")
func mapfast(t *types.Type) int { func mapfast(t *types.Type) int {
// Check ../../runtime/hashmap.go:maxValueSize before changing. // Check ../../runtime/hashmap.go:maxValueSize before changing.
......
...@@ -104,7 +104,7 @@ const ( ...@@ -104,7 +104,7 @@ const (
blEXIT = 3 blEXIT = 3
) )
var bllikelies [4]string = [4]string{"default", "call", "ret", "exit"} var bllikelies = [4]string{"default", "call", "ret", "exit"}
func describePredictionAgrees(b *Block, prediction BranchPrediction) string { func describePredictionAgrees(b *Block, prediction BranchPrediction) string {
s := "" s := ""
......
...@@ -244,7 +244,7 @@ func (t *node32) max() *node32 { ...@@ -244,7 +244,7 @@ func (t *node32) max() *node32 {
} }
func (t *node32) glb(key int32, allow_eq bool) *node32 { func (t *node32) glb(key int32, allow_eq bool) *node32 {
var best *node32 = nil var best *node32
for t != nil { for t != nil {
if key <= t.key { if key <= t.key {
if key == t.key && allow_eq { if key == t.key && allow_eq {
...@@ -262,7 +262,7 @@ func (t *node32) glb(key int32, allow_eq bool) *node32 { ...@@ -262,7 +262,7 @@ func (t *node32) glb(key int32, allow_eq bool) *node32 {
} }
func (t *node32) lub(key int32, allow_eq bool) *node32 { func (t *node32) lub(key int32, allow_eq bool) *node32 {
var best *node32 = nil var best *node32
for t != nil { for t != nil {
if key >= t.key { if key >= t.key {
if key == t.key && allow_eq { if key == t.key && allow_eq {
......
...@@ -1429,9 +1429,9 @@ func FakeRecvType() *Type { ...@@ -1429,9 +1429,9 @@ func FakeRecvType() *Type {
} }
var ( var (
TypeInvalid *Type = newSSA("invalid") TypeInvalid = newSSA("invalid")
TypeMem *Type = newSSA("mem") TypeMem = newSSA("mem")
TypeFlags *Type = newSSA("flags") TypeFlags = newSSA("flags")
TypeVoid *Type = newSSA("void") TypeVoid = newSSA("void")
TypeInt128 *Type = newSSA("int128") TypeInt128 = newSSA("int128")
) )
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