cmd/compile/internal/noder: remove unused noding code

This CL simplifies and removes some old noding code, which isn't
necessary any more.

Most notably, we no longer need separate posMaps for each noder,
because noders are only used for parsing now. Before we started using
types2, noders were also responsible for constructed (untyped) IR, so
posMaps were necessary to translate syntax.Pos into src.XPos.

Change-Id: Ic761abcd727f5ecefc71b611635a0f5b088c941f
Reviewed-on: https://go-review.googlesource.com/c/go/+/463738
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Matthew Dempsky 2022-12-20 15:25:17 -08:00 committed by Gopher Robot
parent 7cf8593140
commit 178080740c
4 changed files with 13 additions and 94 deletions

View file

@ -68,11 +68,11 @@ var localPkgReader *pkgReader
// the unified IR has the full typed AST needed for introspection during step (1).
// In other words, we have all the necessary information to build the generic IR form
// (see writer.captureVars for an example).
func unified(noders []*noder) {
func unified(m posMap, noders []*noder) {
inline.InlineCall = unifiedInlineCall
typecheck.HaveInlineBody = unifiedHaveInlineBody
data := writePkgStub(noders)
data := writePkgStub(m, noders)
// We already passed base.Flag.Lang to types2 to handle validating
// the user's source code. Bump it up now to the current version and
@ -202,8 +202,8 @@ func readBodies(target *ir.Package, duringInlining bool) {
// writePkgStub type checks the given parsed source files,
// writes an export data package stub representing them,
// and returns the result.
func writePkgStub(noders []*noder) string {
m, pkg, info := checkFiles(noders)
func writePkgStub(m posMap, noders []*noder) string {
pkg, info := checkFiles(m, noders)
pw := newPkgWriter(m, pkg, info)