commit | 2df4b9c265f4d2552141ad42cd537b28495a9c81 | [log] [tgz] |
---|---|---|
author | Alexandru Moșoi <mosoi@google.com> | Thu Feb 04 17:21:57 2016 +0100 |
committer | Keith Randall <khr@golang.org> | Thu Feb 04 18:44:03 2016 +0000 |
tree | cad05fe29ead2345ec878a712e1e99dd839858ec | |
parent | 93a0b0f315a1b37e59449740dc5e5bb692b0d9f5 [diff] [blame] |
[dev.ssa] cmd/compile/internal/ssa/gen: move variable reset code into a function Shaves about 3 lines per generated rule. Change-Id: I94adc94ab79f90ac5fd033f896ece3b1eddf0f3d Reviewed-on: https://go-review.googlesource.com/19197 Reviewed-by: Keith Randall <khr@golang.org>
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go index af6bb3b..d71fd8f 100644 --- a/src/cmd/compile/internal/ssa/value.go +++ b/src/cmd/compile/internal/ssa/value.go
@@ -170,6 +170,13 @@ v.Args = v.argstorage[:0] } +func (v *Value) reset(op Op) { + v.Op = op + v.resetArgs() + v.AuxInt = 0 + v.Aux = nil +} + // copyInto makes a new value identical to v and adds it to the end of b. func (v *Value) copyInto(b *Block) *Value { c := b.NewValue0(v.Line, v.Op, v.Type)