diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2022-12-01 16:14:11 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2023-01-25 21:16:32 +0000 |
| commit | 4f467f10820e78add23bf5ddeb1de521aa6f8864 (patch) | |
| tree | bbbec653b076376952b8375e234117e0057ed592 /src/cmd/compile/internal/walk/closure.go | |
| parent | 3d49b683c6095a9a2681e84f05adfbb8d82882e8 (diff) | |
| download | go-4f467f10820e78add23bf5ddeb1de521aa6f8864.tar.xz | |
cmd: remove GOEXPERIMENT=nounified knob
This CL removes the GOEXPERIMENT=nounified knob, and any conditional
statements that depend on that knob. Further CLs to remove unreachable
code follow this one.
Updates #57410.
Change-Id: I39c147e1a83601c73f8316a001705778fee64a91
Reviewed-on: https://go-review.googlesource.com/c/go/+/458615
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/walk/closure.go')
| -rw-r--r-- | src/cmd/compile/internal/walk/closure.go | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/src/cmd/compile/internal/walk/closure.go b/src/cmd/compile/internal/walk/closure.go index 590c9a3ad4..42750c2125 100644 --- a/src/cmd/compile/internal/walk/closure.go +++ b/src/cmd/compile/internal/walk/closure.go @@ -217,7 +217,6 @@ func methodValueWrapper(dot *ir.SelectorExpr) *ir.Name { base.Fatalf("methodValueWrapper: unexpected %v (%v)", dot, dot.Op()) } - t0 := dot.Type() meth := dot.Sel rcvrtype := dot.X.Type() sym := ir.MethodSymSuffix(rcvrtype, meth, "-fm") @@ -227,48 +226,6 @@ func methodValueWrapper(dot *ir.SelectorExpr) *ir.Name { } sym.SetUniq(true) - if base.Debug.Unified != 0 { - base.FatalfAt(dot.Pos(), "missing wrapper for %v", meth) - } - - savecurfn := ir.CurFunc - saveLineNo := base.Pos - ir.CurFunc = nil - - base.Pos = base.AutogeneratedPos - - fn := typecheck.DeclFunc(sym, nil, - typecheck.NewFuncParams(t0.Params(), true), - typecheck.NewFuncParams(t0.Results(), false)) - fn.SetDupok(true) - fn.SetWrapper(true) - - // Declare and initialize variable holding receiver. - ptr := ir.NewHiddenParam(base.Pos, fn, typecheck.Lookup(".this"), rcvrtype) - - call := ir.NewCallExpr(base.Pos, ir.OCALL, ir.NewSelectorExpr(base.Pos, ir.OXDOT, ptr, meth), nil) - call.Args = ir.ParamNames(fn.Type()) - call.IsDDD = fn.Type().IsVariadic() - - var body ir.Node = call - if t0.NumResults() != 0 { - ret := ir.NewReturnStmt(base.Pos, nil) - ret.Results = []ir.Node{call} - body = ret - } - - fn.Body = []ir.Node{body} - typecheck.FinishFuncBody() - - typecheck.Func(fn) - // Need to typecheck the body of the just-generated wrapper. - // typecheckslice() requires that Curfn is set when processing an ORETURN. - ir.CurFunc = fn - typecheck.Stmts(fn.Body) - sym.Def = fn.Nname - typecheck.Target.Decls = append(typecheck.Target.Decls, fn) - ir.CurFunc = savecurfn - base.Pos = saveLineNo - - return fn.Nname + base.FatalfAt(dot.Pos(), "missing wrapper for %v", meth) + panic("unreachable") } |
