diff options
Diffstat (limited to 'src/cmd/compile/internal/walk')
| -rw-r--r-- | src/cmd/compile/internal/walk/closure.go | 47 | ||||
| -rw-r--r-- | src/cmd/compile/internal/walk/convert.go | 2 |
2 files changed, 3 insertions, 46 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") } diff --git a/src/cmd/compile/internal/walk/convert.go b/src/cmd/compile/internal/walk/convert.go index bf06ed6f46..629dd9af4f 100644 --- a/src/cmd/compile/internal/walk/convert.go +++ b/src/cmd/compile/internal/walk/convert.go @@ -45,7 +45,7 @@ func walkConvInterface(n *ir.ConvExpr, init *ir.Nodes) ir.Node { toType := n.Type() if !fromType.IsInterface() && !ir.IsBlank(ir.CurFunc.Nname) { // skip unnamed functions (func _()) - if base.Debug.Unified != 0 && fromType.HasShape() { + if fromType.HasShape() { // Unified IR uses OCONVIFACE for converting all derived types // to interface type. Avoid assertion failure in // MarkTypeUsedInInterface, because we've marked used types |
