1
0
mirror of https://github.com/golang/go synced 2024-11-19 14:34:42 -07:00

cmd/compile: merge tempnamel into tempAt

Passes toolstash-check.

Change-Id: I01ed1c04be5a23756742d461f13f1e587ea7ecb8
Reviewed-on: https://go-review.googlesource.com/59610
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Matthew Dempsky 2017-08-25 15:24:14 -07:00
parent 2dd1f87d38
commit 93471a1390

View File

@ -39,7 +39,7 @@ func autotmpname(n int) string {
}
// make a new Node off the books
func tempnamel(pos src.XPos, curfn *Node, nn *Node, t *types.Type) {
func tempAt(pos src.XPos, curfn *Node, t *types.Type) *Node {
if curfn == nil {
Fatalf("no curfn for tempname")
}
@ -61,23 +61,15 @@ func tempnamel(pos src.XPos, curfn *Node, nn *Node, t *types.Type) {
n.SetClass(PAUTO)
n.Esc = EscNever
n.Name.Curfn = curfn
n.Name.SetUsed(true)
n.Name.SetAutoTemp(true)
curfn.Func.Dcl = append(curfn.Func.Dcl, n)
dowidth(t)
*nn = *n
return n.Orig
}
func temp(t *types.Type) *Node {
var n Node
tempnamel(lineno, Curfn, &n, t)
asNode(n.Sym.Def).Name.SetUsed(true)
return n.Orig
}
func tempAt(pos src.XPos, curfn *Node, t *types.Type) *Node {
var n Node
tempnamel(pos, curfn, &n, t)
asNode(n.Sym.Def).Name.SetUsed(true)
return n.Orig
return tempAt(lineno, Curfn, t)
}