Commit 7f13fbf7 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: small cleanup to syslook calls

Passing copy==1 to syslook is only necessary to support subsequent
calls to substArgTypes.  typ2Itab and concatstring* don't have "any"
parameters, so no point in deep copying their function signatures at
every call site.

For a couple other syslook calls (makemap and conv[IET]2[IET]), move
them closer to their corresponding substArgTypes calls so it's easier
to see that all syslook(fn, 1) calls are necessary.

Change-Id: I4a0588ab2b8b5b8ce7a0a44b24c8cf8fda489af6
Reviewed-on: https://go-review.googlesource.com/20215
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 646939c0
......@@ -957,11 +957,6 @@ opswitch:
break
}
// Build name of function: convI2E etc.
// Not all names are possible
// (e.g., we'll never generate convE2E or convE2I).
buf := "conv" + type2IET(n.Left.Type) + "2" + type2IET(n.Type)
fn := syslook(buf, 1)
var ll *NodeList
if !Isinter(n.Left.Type) {
ll = list(ll, typename(n.Left.Type))
......@@ -1002,7 +997,7 @@ opswitch:
typecheck(&n1, Etop)
appendNodeSeqNode(init, n1)
fn := syslook("typ2Itab", 1)
fn := syslook("typ2Itab", 0)
n1 = Nod(OCALL, fn, nil)
setNodeSeq(&n1.List, ll)
typecheck(&n1, Erv)
......@@ -1051,6 +1046,11 @@ opswitch:
ll = list(ll, r)
}
// Build name of function: convI2E etc.
// Not all names are possible
// (e.g., we'll never generate convE2E or convE2I).
buf := "conv" + type2IET(n.Left.Type) + "2" + type2IET(n.Type)
fn := syslook(buf, 1)
if !Isinter(n.Left.Type) {
substArgTypes(fn, n.Left.Type, n.Left.Type, n.Type)
} else {
......@@ -1377,8 +1377,6 @@ opswitch:
case OMAKEMAP:
t := n.Type
fn := syslook("makemap", 1)
a := nodnil() // hmap buffer
r := nodnil() // bucket buffer
if n.Esc == EscNone {
......@@ -1401,6 +1399,7 @@ opswitch:
r = Nod(OADDR, var_, nil)
}
fn := syslook("makemap", 1)
substArgTypes(fn, hmap(t), mapbucket(t), t.Down, t.Type)
n = mkcall1(fn, n.Type, init, typename(n.Type), conv(n.Left, Types[TINT64]), a, r)
......@@ -2760,7 +2759,7 @@ func addstr(n *Node, init nodesOrNodeListPtr) *Node {
slice.Esc = EscNone
}
cat := syslook(fn, 1)
cat := syslook(fn, 0)
r := Nod(OCALL, cat, nil)
setNodeSeq(&r.List, args)
typecheck(&r, Erv)
......
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