Commit ea918ef5 authored by Russ Cox's avatar Russ Cox

Revert "cmd/compile: define func value symbols at declaration"

This reverts commit 3b411bf1a1bb08d6868083981cecba8088dc7aea.

Change-Id: I321a43fa378a43b3e4d7aa97e0222775640af64b
Reviewed-on: https://go-review.googlesource.com/12205Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent fa1ea497
...@@ -199,7 +199,6 @@ func makeclosure(func_ *Node) *Node { ...@@ -199,7 +199,6 @@ func makeclosure(func_ *Node) *Node {
xfunc.Func.Nname.Name.Funcdepth = func_.Func.Depth xfunc.Func.Nname.Name.Funcdepth = func_.Func.Depth
xfunc.Func.Depth = func_.Func.Depth xfunc.Func.Depth = func_.Func.Depth
xfunc.Func.Endlineno = func_.Func.Endlineno xfunc.Func.Endlineno = func_.Func.Endlineno
makefuncsym(xfunc.Func.Nname.Sym)
xfunc.Nbody = func_.Nbody xfunc.Nbody = func_.Nbody
xfunc.Func.Dcl = concat(func_.Func.Dcl, xfunc.Func.Dcl) xfunc.Func.Dcl = concat(func_.Func.Dcl, xfunc.Func.Dcl)
......
...@@ -585,10 +585,6 @@ func funchdr(n *Node) { ...@@ -585,10 +585,6 @@ func funchdr(n *Node) {
Fatal("funchdr: dclcontext") Fatal("funchdr: dclcontext")
} }
if importpkg == nil && n.Func.Nname != nil {
makefuncsym(n.Func.Nname.Sym)
}
dclcontext = PAUTO dclcontext = PAUTO
markdcl() markdcl()
Funcdepth++ Funcdepth++
...@@ -1493,16 +1489,12 @@ func funcsym(s *Sym) *Sym { ...@@ -1493,16 +1489,12 @@ func funcsym(s *Sym) *Sym {
} }
s1 := Pkglookup(s.Name+"·f", s.Pkg) s1 := Pkglookup(s.Name+"·f", s.Pkg)
if s1.Def == nil {
s1.Def = newfuncname(s1)
s1.Def.Func.Shortname = newname(s)
funcsyms = list(funcsyms, s1.Def)
}
s.Fsym = s1 s.Fsym = s1
return s1
}
func makefuncsym(s *Sym) { return s1
if isblanksym(s) {
return
}
s1 := funcsym(s)
s1.Def = newfuncname(s1)
s1.Def.Func.Shortname = newname(s)
funcsyms = list(funcsyms, s1.Def)
} }
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