Commit 45ce10fa authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: use newfuncname in dclfunc

Eliminates an inconsistency between user functions and generated
functions.

Passes toolstash-check.

Change-Id: I946b511ca81d88a0024b5932cb50f3d8b9e808f4
Reviewed-on: https://go-review.googlesource.com/103863
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent b834cd9a
......@@ -676,7 +676,7 @@ func fileLine(n *Node) (file string, line int) {
}
func isInlineable(n *Node) bool {
if exportInlined && n != nil && n.Func != nil {
if exportInlined && n != nil {
// When lazily typechecking inlined bodies, some
// re-exported ones may not have been typechecked yet.
// Currently that can leave unresolved ONONAMEs in
......
......@@ -1060,7 +1060,7 @@ func dclfunc(sym *types.Sym, tfn *Node) *Node {
}
fn := nod(ODCLFUNC, nil, nil)
fn.Func.Nname = newname(sym)
fn.Func.Nname = newfuncname(sym)
fn.Func.Nname.Name.Defn = fn
fn.Func.Nname.Name.Param.Ntype = tfn
declare(fn.Func.Nname, PFUNC)
......
......@@ -198,10 +198,6 @@ func inlFlood(n *Node) {
Fatalf("inlFlood: unexpected %v, %v, %v", n, n.Op, n.Class())
}
if n.Func == nil {
// TODO(mdempsky): Should init have a Func too?
if n.Sym.Name == "init" {
return
}
Fatalf("inlFlood: missing Func on %v", n)
}
if n.Func.Inl.Len() == 0 {
......
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