cmd: remove a few more unused parameters

ssa's pos parameter on the Const* funcs is unused, so remove it.

ld's alloc parameter on elfnote is always true, so remove the arguments
and simplify the code.

Finally, arm's addpltreloc never has its return parameter used, so
remove it.

Change-Id: I63387ecf6ab7b5f7c20df36be823322bb98427b8
Reviewed-on: https://go-review.googlesource.com/104456
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Daniel Martí 2018-04-03 15:52:30 +01:00
parent 54c3f56ee0
commit 14393c5cd4
7 changed files with 51 additions and 56 deletions

View file

@ -444,8 +444,7 @@ func (b *Block) NewValue4(pos src.XPos, op Op, t *types.Type, arg0, arg1, arg2,
}
// constVal returns a constant value for c.
func (f *Func) constVal(pos src.XPos, op Op, t *types.Type, c int64, setAuxInt bool) *Value {
// TODO remove unused pos parameter, both here and in *func.ConstXXX callers.
func (f *Func) constVal(op Op, t *types.Type, c int64, setAuxInt bool) *Value {
if f.constants == nil {
f.constants = make(map[int64][]*Value)
}
@ -480,48 +479,48 @@ const (
)
// ConstInt returns an int constant representing its argument.
func (f *Func) ConstBool(pos src.XPos, t *types.Type, c bool) *Value {
func (f *Func) ConstBool(t *types.Type, c bool) *Value {
i := int64(0)
if c {
i = 1
}
return f.constVal(pos, OpConstBool, t, i, true)
return f.constVal(OpConstBool, t, i, true)
}
func (f *Func) ConstInt8(pos src.XPos, t *types.Type, c int8) *Value {
return f.constVal(pos, OpConst8, t, int64(c), true)
func (f *Func) ConstInt8(t *types.Type, c int8) *Value {
return f.constVal(OpConst8, t, int64(c), true)
}
func (f *Func) ConstInt16(pos src.XPos, t *types.Type, c int16) *Value {
return f.constVal(pos, OpConst16, t, int64(c), true)
func (f *Func) ConstInt16(t *types.Type, c int16) *Value {
return f.constVal(OpConst16, t, int64(c), true)
}
func (f *Func) ConstInt32(pos src.XPos, t *types.Type, c int32) *Value {
return f.constVal(pos, OpConst32, t, int64(c), true)
func (f *Func) ConstInt32(t *types.Type, c int32) *Value {
return f.constVal(OpConst32, t, int64(c), true)
}
func (f *Func) ConstInt64(pos src.XPos, t *types.Type, c int64) *Value {
return f.constVal(pos, OpConst64, t, c, true)
func (f *Func) ConstInt64(t *types.Type, c int64) *Value {
return f.constVal(OpConst64, t, c, true)
}
func (f *Func) ConstFloat32(pos src.XPos, t *types.Type, c float64) *Value {
return f.constVal(pos, OpConst32F, t, int64(math.Float64bits(float64(float32(c)))), true)
func (f *Func) ConstFloat32(t *types.Type, c float64) *Value {
return f.constVal(OpConst32F, t, int64(math.Float64bits(float64(float32(c)))), true)
}
func (f *Func) ConstFloat64(pos src.XPos, t *types.Type, c float64) *Value {
return f.constVal(pos, OpConst64F, t, int64(math.Float64bits(c)), true)
func (f *Func) ConstFloat64(t *types.Type, c float64) *Value {
return f.constVal(OpConst64F, t, int64(math.Float64bits(c)), true)
}
func (f *Func) ConstSlice(pos src.XPos, t *types.Type) *Value {
return f.constVal(pos, OpConstSlice, t, constSliceMagic, false)
func (f *Func) ConstSlice(t *types.Type) *Value {
return f.constVal(OpConstSlice, t, constSliceMagic, false)
}
func (f *Func) ConstInterface(pos src.XPos, t *types.Type) *Value {
return f.constVal(pos, OpConstInterface, t, constInterfaceMagic, false)
func (f *Func) ConstInterface(t *types.Type) *Value {
return f.constVal(OpConstInterface, t, constInterfaceMagic, false)
}
func (f *Func) ConstNil(pos src.XPos, t *types.Type) *Value {
return f.constVal(pos, OpConstNil, t, constNilMagic, false)
func (f *Func) ConstNil(t *types.Type) *Value {
return f.constVal(OpConstNil, t, constNilMagic, false)
}
func (f *Func) ConstEmptyString(pos src.XPos, t *types.Type) *Value {
v := f.constVal(pos, OpConstString, t, constEmptyStringMagic, false)
func (f *Func) ConstEmptyString(t *types.Type) *Value {
v := f.constVal(OpConstString, t, constEmptyStringMagic, false)
v.Aux = ""
return v
}
func (f *Func) ConstOffPtrSP(pos src.XPos, t *types.Type, c int64, sp *Value) *Value {
v := f.constVal(pos, OpOffPtr, t, c, true)
func (f *Func) ConstOffPtrSP(t *types.Type, c int64, sp *Value) *Value {
v := f.constVal(OpOffPtr, t, c, true)
if len(v.Args) == 0 {
v.AddArg(sp)
}