mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: rename Func.constVal arg for clarity
Values have an Aux and an AuxInt. We're setting AuxInt, not Aux. Say so. Change-Id: I41aa783273bb7e1ba47c941aa4233f818e37dadd Reviewed-on: https://go-review.googlesource.com/37997 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
2a5cf48f91
commit
c63ad970f6
1 changed files with 3 additions and 3 deletions
|
|
@ -335,21 +335,21 @@ func (b *Block) NewValue4(pos src.XPos, op Op, t Type, arg0, arg1, arg2, arg3 *V
|
||||||
}
|
}
|
||||||
|
|
||||||
// constVal returns a constant value for c.
|
// constVal returns a constant value for c.
|
||||||
func (f *Func) constVal(pos src.XPos, op Op, t Type, c int64, setAux bool) *Value {
|
func (f *Func) constVal(pos src.XPos, op Op, t Type, c int64, setAuxInt bool) *Value {
|
||||||
if f.constants == nil {
|
if f.constants == nil {
|
||||||
f.constants = make(map[int64][]*Value)
|
f.constants = make(map[int64][]*Value)
|
||||||
}
|
}
|
||||||
vv := f.constants[c]
|
vv := f.constants[c]
|
||||||
for _, v := range vv {
|
for _, v := range vv {
|
||||||
if v.Op == op && v.Type.Compare(t) == CMPeq {
|
if v.Op == op && v.Type.Compare(t) == CMPeq {
|
||||||
if setAux && v.AuxInt != c {
|
if setAuxInt && v.AuxInt != c {
|
||||||
panic(fmt.Sprintf("cached const %s should have AuxInt of %d", v.LongString(), c))
|
panic(fmt.Sprintf("cached const %s should have AuxInt of %d", v.LongString(), c))
|
||||||
}
|
}
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var v *Value
|
var v *Value
|
||||||
if setAux {
|
if setAuxInt {
|
||||||
v = f.Entry.NewValue0I(pos, op, t, c)
|
v = f.Entry.NewValue0I(pos, op, t, c)
|
||||||
} else {
|
} else {
|
||||||
v = f.Entry.NewValue0(pos, op, t)
|
v = f.Entry.NewValue0(pos, op, t)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue