Commit bc972e8e authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: remove lookupf

Change-Id: I4de5173fa50fbf90802d1d2428824702f2118dde
Reviewed-on: https://go-review.googlesource.com/39030
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 361af94d
......@@ -196,7 +196,7 @@ func closurename(n *Node) *Sym {
default:
Fatalf("closurename called for %S", n)
}
n.Sym = lookupf("%s.%s%d", outer, prefix, gen)
n.Sym = lookup(fmt.Sprintf("%s.%s%d", outer, prefix, gen))
return n.Sym
}
......@@ -344,7 +344,7 @@ func transformclosure(xfunc *Node) {
// we introduce function param &v *T
// and v remains PAUTOHEAP with &v heapaddr
// (accesses will implicitly deref &v).
addr := newname(lookupf("&%s", v.Sym.Name))
addr := newname(lookup("&" + v.Sym.Name))
addr.Type = typPtr(v.Type)
addr.Class = PPARAM
v.Name.Param.Heapaddr = addr
......@@ -394,7 +394,7 @@ func transformclosure(xfunc *Node) {
} else {
// Declare variable holding addresses taken from closure
// and initialize in entry prologue.
addr := newname(lookupf("&%s", v.Sym.Name))
addr := newname(lookup("&" + v.Sym.Name))
addr.Name.Param.Ntype = nod(OIND, typenod(v.Type), nil)
addr.Class = PAUTO
addr.SetUsed(true)
......
......@@ -211,10 +211,6 @@ func lookup(name string) *Sym {
return localpkg.Lookup(name)
}
func lookupf(format string, a ...interface{}) *Sym {
return lookup(fmt.Sprintf(format, a...))
}
// lookupN looks up the symbol starting with prefix and ending with
// the decimal n. If prefix is too long, lookupN panics.
func lookupN(prefix string, n int) *Sym {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment