]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: replace misleading variable name
authorMartin Möhrmann <moehrmann@google.com>
Sun, 21 Jan 2018 09:25:07 +0000 (10:25 +0100)
committerMartin Möhrmann <moehrmann@google.com>
Sat, 17 Feb 2018 15:28:55 +0000 (15:28 +0000)
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 <moehrmann@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/order.go

index b0115fe73341c1b03279f6f1537d70909dba8b24..01da56ce280a398949c2e6d3c4bb7217b52a70a1 100644 (file)
@@ -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)