Skip to content

Commit

Permalink
cmd/compile: add comment to statictmp name generation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
josharian committed Mar 31, 2017
1 parent 8e36575 commit bfeda6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/compile/internal/gc/sinit.go
Expand Up @@ -575,6 +575,7 @@ var statuniqgen int // name generator for static temps
// Callers should call n.Name.SetReadonly(true) on the
// returned node for readonly nodes.
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)))
statuniqgen++
addvar(n, t, PEXTERN)
Expand Down

0 comments on commit bfeda6c

Please sign in to comment.