mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: refactor how declarations are imported
This CL moves all of the logic for wiring up imported declarations into export.go, so that it can be reused by the indexed importer code. While here, increase symmetry across routines. Passes toolstash-check. Change-Id: I1ccec5c3999522b010e4d04ed56b632fd4d712d9 Reviewed-on: https://go-review.googlesource.com/107621 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
514018c0aa
commit
dd71e3fef4
3 changed files with 84 additions and 87 deletions
|
|
@ -915,12 +915,9 @@ func loadsys() {
|
|||
typ := typs[d.typ]
|
||||
switch d.tag {
|
||||
case funcTag:
|
||||
importsym(Runtimepkg, sym, ONAME)
|
||||
n := newfuncname(sym)
|
||||
n.Type = typ
|
||||
declare(n, PFUNC)
|
||||
importfunc(Runtimepkg, src.NoXPos, sym, typ)
|
||||
case varTag:
|
||||
importvar(lineno, Runtimepkg, sym, typ)
|
||||
importvar(Runtimepkg, src.NoXPos, sym, typ)
|
||||
default:
|
||||
Fatalf("unhandled declaration tag %v", d.tag)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue