]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.unified] cmd/compile: drop package height from Unified IR importer
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 8 Jun 2022 04:05:28 +0000 (11:05 +0700)
committerGopher Robot <gobot@golang.org>
Mon, 27 Jun 2022 22:54:46 +0000 (22:54 +0000)
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>

src/cmd/compile/internal/importer/ureader.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/writer.go
src/go/internal/gcimporter/ureader.go

index dc5614c8410760a64bf676302fb7ff72620d7a4a..ccd4c7c502dc232694a26b347b411307439a4384 100644 (file)
@@ -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
 
index fed500bcf14b7775593d030e3907c1034b7858be..c8ed8552cd0825e4cb0b32ba6382a5bd3506c380 100644 (file)
@@ -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, "")
 
index 0537d1d3b2365d73b11ba6cd5935d235c03b0b8e..ff026ba5ca545816b3993a16bd8fa6f13ba2fd02 100644 (file)
@@ -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() {
index 3b14232c8196acb9d19832d623dc8f75338ef626..63718a59e18400fd1afdbae03bfe695b137ca4cd 100644 (file)
@@ -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())