aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/unified.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-12-20 15:25:17 -0800
committerGopher Robot <gobot@golang.org>2023-01-27 03:43:35 +0000
commit178080740c1bc33f2c7f164504eedc24210bbf1e (patch)
tree15ac345b4921846611da770642725290a99122b4 /src/cmd/compile/internal/noder/unified.go
parent7cf8593140f41358f77041ab0fc6ca7e99f6e715 (diff)
downloadgo-178080740c1bc33f2c7f164504eedc24210bbf1e.tar.xz
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>
Diffstat (limited to 'src/cmd/compile/internal/noder/unified.go')
-rw-r--r--src/cmd/compile/internal/noder/unified.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/noder/unified.go b/src/cmd/compile/internal/noder/unified.go
index ed97a09302..f1788c210e 100644
--- a/src/cmd/compile/internal/noder/unified.go
+++ b/src/cmd/compile/internal/noder/unified.go
@@ -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)