From 284a4a734662b3c1a93f993ef55c8c2f42513c06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20M=C3=B6hrmann?= Date: Sun, 21 Jan 2018 10:25:07 +0100 Subject: [PATCH] cmd/compile: replace misleading variable name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit One of the variables declared in cleantempnopop named 'kill' does not hold a OVARKILL node but an OVARLIVE node. Rename that variable to 'live' to differentiate it from the other variable named kill that holds a OVARKILL node. Passes toolstash -cmp. Change-Id: I34c8729e5c303b8cdabe44c9af980d4f16000e4b Reviewed-on: https://go-review.googlesource.com/88816 Run-TryBot: Martin Möhrmann Reviewed-by: Daniel Martí Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/order.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go index b0115fe733..01da56ce28 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go @@ -231,18 +231,18 @@ func poptemp(mark ordermarker, order *Order) { order.temp = order.temp[:mark] } -// Cleantempnopop emits to *out VARKILL instructions for each temporary -// above the mark on the temporary stack, but it does not pop them -// from the stack. +// Cleantempnopop emits VARKILL and if needed VARLIVE instructions +// to *out for each temporary above the mark on the temporary stack. +// It does not pop the temporaries from the stack. func cleantempnopop(mark ordermarker, order *Order, out *[]*Node) { for i := len(order.temp) - 1; i >= int(mark); i-- { n := order.temp[i] if n.Name.Keepalive() { n.Name.SetKeepalive(false) n.SetAddrtaken(true) // ensure SSA keeps the n variable - kill := nod(OVARLIVE, n, nil) - kill = typecheck(kill, Etop) - *out = append(*out, kill) + live := nod(OVARLIVE, n, nil) + live = typecheck(live, Etop) + *out = append(*out, live) } kill := nod(OVARKILL, n, nil) kill = typecheck(kill, Etop) -- 2.50.0