aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/pkg.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2020-11-30 00:01:26 -0800
committerMatthew Dempsky <mdempsky@google.com>2020-12-01 01:26:28 +0000
commit0f9f27287b6eaac1634248e325aaab848e0dfd55 (patch)
treeeecef0d14ca1fdc8779dce007e9f00e8734493bc /src/cmd/compile/internal/types/pkg.go
parent41ad4dec991c11d9e1efff27fc0b1568f5981c9c (diff)
downloadgo-0f9f27287b6eaac1634248e325aaab848e0dfd55.tar.gz
go-0f9f27287b6eaac1634248e325aaab848e0dfd55.zip
[dev.regabi] cmd/compile: remove types.InitSyms
It's not types's responsibility to understand how package initialization is implemented. Instead, have gc keep track of the order that packages were imported, and then look for inittask declarations. Also, use resolve to force importing of the inittask's export data, so that we can get the appropriate linker symbol index. (This is also why this CL doesn't satisfy "toolstash -cmp".) Change-Id: I5b706497d4a8d1c4439178863b4a8dba4da0f5a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/274006 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types/pkg.go')
-rw-r--r--src/cmd/compile/internal/types/pkg.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/types/pkg.go b/src/cmd/compile/internal/types/pkg.go
index bcc6789509..bf90570b53 100644
--- a/src/cmd/compile/internal/types/pkg.go
+++ b/src/cmd/compile/internal/types/pkg.go
@@ -84,9 +84,6 @@ func (pkg *Pkg) Lookup(name string) *Sym {
return s
}
-// List of .inittask entries in imported packages, in source code order.
-var InitSyms []*Sym
-
// LookupOK looks up name in pkg and reports whether it previously existed.
func (pkg *Pkg) LookupOK(name string) (s *Sym, existed bool) {
// TODO(gri) remove this check in favor of specialized lookup
@@ -101,9 +98,6 @@ func (pkg *Pkg) LookupOK(name string) (s *Sym, existed bool) {
Name: name,
Pkg: pkg,
}
- if name == ".inittask" {
- InitSyms = append(InitSyms, s)
- }
pkg.Syms[name] = s
return s, false
}