]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify asmhdr and plugin exports handling
authorMatthew Dempsky <mdempsky@google.com>
Fri, 11 Aug 2023 19:04:22 +0000 (12:04 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 11 Aug 2023 20:54:14 +0000 (20:54 +0000)
commitf47cfd6cb55ce0ba6a3f77eeb33c60713f8493e9
tree56a1200395ec820604d9f0fa4e7afcaa2aed850b
parent61719e18f7715e4fbd0914395633b15a4a2e17a7
cmd/compile: simplify asmhdr and plugin exports handling

This CL removes a bunch of obsolete code, which made the overall
possible data flow of the compiler much harder to understand. In
particular, it:

1. Removes typecheck.Declare by inlining its only two remaining uses,
and simplifying them down to just the couple of relevant assignments
for each remaining caller.

2. Renames ir.Package.{Asms,Exports} to {AsmHdrDecls,PluginExports},
respectively, to better describe what they're used for. In particular,
PluginExports now actually holds only the subset of Exports that used
to be confusingly called "ptabs" in package reflectdata.

3. Renames reflectdata.WriteTabs to reflectdata.WritePluginTable, to
make it clearer what it does.

4. Removes the consistency checks on len(Exports) and len(ptabs),
since now it's plainly obvious that only the unified importer ever
appends to PluginExports.

Change-Id: Iedc9d0a4e7648de4e734f7e3e7df302580fed542
Reviewed-on: https://go-review.googlesource.com/c/go/+/518757
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/export.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/ir/package.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/pkginit/init.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/typecheck/dcl.go