mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: cleaner solution for importing init functions
Using oldname+resolve is how typecheck handles this anyway. Passes toolstash -cmp, with both -iexport enabled and disabled. Change-Id: I12b0f0333d6b86ce6bfc4d416c461b5f15c1110d Reviewed-on: https://go-review.googlesource.com/109715 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
148a26539b
commit
ae2a2d12f6
2 changed files with 11 additions and 16 deletions
|
|
@ -67,17 +67,6 @@ func parseFiles(filenames []string) uint {
|
|||
|
||||
localpkg.Height = myheight
|
||||
|
||||
if flagiexport {
|
||||
// init.go requires all imported init functions to be
|
||||
// fully resolved.
|
||||
// TODO(mdempsky): Can this be done elsewhere more cleanly?
|
||||
for _, s := range types.InitSyms {
|
||||
if n := asNode(s.Def); n != nil && s.Pkg != localpkg {
|
||||
resolve(n)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue