From e146d3eafafe149aa3a28e6a251db9c01d04f11d Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 15 Feb 2022 11:39:41 -0800 Subject: cmd/compile: switch to final unified IR export format Now that there's a native go/types importer for unified IR, the compiler no longer needs to stay backwards compatible with old iexport importers. This CL also updates the go/types and go/internal/gcimporter tests to expect that the unified IR importer sets the receiver parameter type to the underlying Interface type, rather than the Named type. This is a temporary workaround until we make a decision on #49906. Notably, this makes `GOEXPERIMENT=unified go test` work on generics code without requiring `-vet=off` (because previously cmd/vet was relying on unified IR's backwards-compatible iexport data, which omitted generic types). Change-Id: Iac7a2346bb7a91e6690fb2978fb702fadae5559d Reviewed-on: https://go-review.googlesource.com/c/go/+/386004 Trust: Matthew Dempsky Run-TryBot: Matthew Dempsky Reviewed-by: Robert Griesemer Reviewed-by: Robert Findley TryBot-Result: Gopher Robot --- src/cmd/compile/internal/noder/reader.go | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/cmd/compile/internal/noder/reader.go') diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go index 71efac80aa..1350c22467 100644 --- a/src/cmd/compile/internal/noder/reader.go +++ b/src/cmd/compile/internal/noder/reader.go @@ -589,10 +589,6 @@ func (pr *pkgReader) objIdx(idx int, implicits, explicits []*types.Type) ir.Node if pri, ok := objReader[sym]; ok { return pri.pr.objIdx(pri.idx, nil, explicits) } - if haveLegacyImports { - assert(len(explicits) == 0) - return typecheck.Resolve(ir.NewIdent(src.NoXPos, sym)) - } base.Fatalf("unresolved stub: %v", sym) } @@ -1972,12 +1968,6 @@ func InlineCall(call *ir.CallExpr, fn *ir.Func, inlIndex int) *ir.InlinedCallExp pri, ok := bodyReader[fn] if !ok { - // Assume it's an imported function or something that we don't - // have access to in quirks mode. - if haveLegacyImports { - return nil - } - base.FatalfAt(call.Pos(), "missing function body for call to %v", fn) } -- cgit v1.3-5-g9baa