diff options
| author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2020-12-31 16:51:12 +0700 |
|---|---|---|
| committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2020-12-31 10:55:44 +0000 |
| commit | dfbcff80c65991e90b7a06a09e4399f7725356dc (patch) | |
| tree | 7252e4249895cabc0506884d2a95d5b5080a8e8d /src | |
| parent | 77fd81a3e6c4aa248df135cc24be2871689cc7c3 (diff) | |
| download | go-git-dfbcff80c65991e90b7a06a09e4399f7725356dc.tar.gz | |
[dev.regabi] cmd/compile: make copyExpr return *ir.Name directly
copyExpr just calls copyExpr1 with "clear" is false, so make it return
*ir.Name directly instead of ir.Node
Passes toolstash -cmp.
Change-Id: I31ca1d88d9eaf8ac37517022f1c74285ffce07d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/280714
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/walk/order.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/walk/order.go b/src/cmd/compile/internal/walk/order.go index 681f5dcc76..a2bd0cf10a 100644 --- a/src/cmd/compile/internal/walk/order.go +++ b/src/cmd/compile/internal/walk/order.go @@ -102,7 +102,7 @@ func (o *orderState) newTemp(t *types.Type, clear bool) *ir.Name { // copyExpr behaves like newTemp but also emits // code to initialize the temporary to the value n. -func (o *orderState) copyExpr(n ir.Node) ir.Node { +func (o *orderState) copyExpr(n ir.Node) *ir.Name { return o.copyExpr1(n, false) } @@ -518,7 +518,7 @@ func (o *orderState) call(nn ir.Node) { x := o.copyExpr(arg.X) arg.X = x x.Name().SetAddrtaken(true) // ensure SSA keeps the x variable - n.KeepAlive = append(n.KeepAlive, x.(*ir.Name)) + n.KeepAlive = append(n.KeepAlive, x) } } } |
