Skip to content

Commit

Permalink
[dev.unified] cmd/compile: drop package height from Unified IR importer
Browse files Browse the repository at this point in the history
CL 410342 removed package height, but still needs to keep writing out 0
for iexport for compatibility with existing importers. With Unified IR,
we don't have to, so get rid of the package height completely.

Change-Id: I84a285cbaddd7bb0833d45a24a6818231b4d2b71
Reviewed-on: https://go-review.googlesource.com/c/go/+/411014
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
  • Loading branch information
cuonglm authored and gopherbot committed Jun 27, 2022
1 parent 398d46d commit 4b78ece
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/importer/ureader.go
Expand Up @@ -162,8 +162,6 @@ func (r *reader) doPkg() *types2.Package {
}

name := r.String()
_ = r.Len() // was package height, but not necessary anymore.

pkg := types2.NewPackage(path, name)
r.p.imports[path] = pkg

Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/noder/reader.go
Expand Up @@ -292,7 +292,6 @@ func (r *reader) doPkg() *types.Pkg {
}

name := r.String()
_ = r.Len() // was package height, but not necessary anymore.

pkg := types.NewPkg(path, "")

Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/noder/writer.go
Expand Up @@ -328,7 +328,6 @@ func (pw *pkgWriter) pkgIdx(pkg *types2.Package) pkgbits.Index {
base.Assertf(path != "builtin" && path != "unsafe", "unexpected path for user-defined package: %q", path)
w.String(path)
w.String(pkg.Name())
w.Len(0) // was package height, but not necessary anymore.

w.Len(len(pkg.Imports()))
for _, imp := range pkg.Imports() {
Expand Down
4 changes: 1 addition & 3 deletions src/go/internal/gcimporter/ureader.go
Expand Up @@ -198,10 +198,8 @@ func (r *reader) doPkg() *types.Package {
}

name := r.String()
height := r.Len()

// Was: "pkg := types.NewPackageHeight(path, name, height)"
pkg, _ := types.NewPackage(path, name), height
pkg := types.NewPackage(path, name)
r.p.imports[path] = pkg

imports := make([]*types.Package, r.Len())
Expand Down

0 comments on commit 4b78ece

Please sign in to comment.