1
0
mirror of https://github.com/golang/go synced 2024-11-18 03:54:50 -07:00

cmd/compile: add comment to statictmp name generation

Follow-up to review comments on CL 39193.

Change-Id: I7649af9d70ad73e039061a7a66fea416a7476192
Reviewed-on: https://go-review.googlesource.com/39199
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-03-31 16:04:52 -07:00
parent 8e36575ebe
commit bfeda6ccc7

View File

@ -575,6 +575,7 @@ var statuniqgen int // name generator for static temps
// Callers should call n.Name.SetReadonly(true) on the // Callers should call n.Name.SetReadonly(true) on the
// returned node for readonly nodes. // returned node for readonly nodes.
func staticname(t *Type) *Node { func staticname(t *Type) *Node {
// Don't use lookupN; it interns the resulting string, but these are all unique.
n := newname(lookup(fmt.Sprintf("statictmp_%d", statuniqgen))) n := newname(lookup(fmt.Sprintf("statictmp_%d", statuniqgen)))
statuniqgen++ statuniqgen++
addvar(n, t, PEXTERN) addvar(n, t, PEXTERN)