mirror of
https://github.com/golang/go
synced 2024-11-16 23:14:42 -07:00
[dev.unified] cmd/compile: drop package height from Unified IR importer
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>
This commit is contained in:
parent
398d46d538
commit
4b78ece3d7
@ -162,8 +162,6 @@ func (r *reader) doPkg() *types2.Package {
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := r.String()
|
name := r.String()
|
||||||
_ = r.Len() // was package height, but not necessary anymore.
|
|
||||||
|
|
||||||
pkg := types2.NewPackage(path, name)
|
pkg := types2.NewPackage(path, name)
|
||||||
r.p.imports[path] = pkg
|
r.p.imports[path] = pkg
|
||||||
|
|
||||||
|
@ -292,7 +292,6 @@ func (r *reader) doPkg() *types.Pkg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := r.String()
|
name := r.String()
|
||||||
_ = r.Len() // was package height, but not necessary anymore.
|
|
||||||
|
|
||||||
pkg := types.NewPkg(path, "")
|
pkg := types.NewPkg(path, "")
|
||||||
|
|
||||||
|
@ -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)
|
base.Assertf(path != "builtin" && path != "unsafe", "unexpected path for user-defined package: %q", path)
|
||||||
w.String(path)
|
w.String(path)
|
||||||
w.String(pkg.Name())
|
w.String(pkg.Name())
|
||||||
w.Len(0) // was package height, but not necessary anymore.
|
|
||||||
|
|
||||||
w.Len(len(pkg.Imports()))
|
w.Len(len(pkg.Imports()))
|
||||||
for _, imp := range pkg.Imports() {
|
for _, imp := range pkg.Imports() {
|
||||||
|
@ -198,10 +198,8 @@ func (r *reader) doPkg() *types.Package {
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := r.String()
|
name := r.String()
|
||||||
height := r.Len()
|
|
||||||
|
|
||||||
// Was: "pkg := types.NewPackageHeight(path, name, height)"
|
pkg := types.NewPackage(path, name)
|
||||||
pkg, _ := types.NewPackage(path, name), height
|
|
||||||
r.p.imports[path] = pkg
|
r.p.imports[path] = pkg
|
||||||
|
|
||||||
imports := make([]*types.Package, r.Len())
|
imports := make([]*types.Package, r.Len())
|
||||||
|
Loading…
Reference in New Issue
Block a user