diff options
Diffstat (limited to 'src/cmd/compile/internal/gc/gsubr.go')
-rw-r--r-- | src/cmd/compile/internal/gc/gsubr.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go index 6ea9b354ab..f24687ec0f 100644 --- a/src/cmd/compile/internal/gc/gsubr.go +++ b/src/cmd/compile/internal/gc/gsubr.go @@ -34,6 +34,7 @@ import ( "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/ssa" + "cmd/compile/internal/typecheck" "cmd/compile/internal/types" "cmd/internal/obj" "cmd/internal/objabi" @@ -196,11 +197,11 @@ func makeABIWrapper(f *ir.Func, wrapperABI obj.ABI) { // Q: is this needed? savepos := base.Pos - savedclcontext := dclcontext + savedclcontext := typecheck.DeclContext savedcurfn := ir.CurFunc base.Pos = base.AutogeneratedPos - dclcontext = ir.PEXTERN + typecheck.DeclContext = ir.PEXTERN // At the moment we don't support wrapping a method, we'd need machinery // below to handle the receiver. Panic if we see this scenario. @@ -213,11 +214,11 @@ func makeABIWrapper(f *ir.Func, wrapperABI obj.ABI) { var noReceiver *ir.Field tfn := ir.NewFuncType(base.Pos, noReceiver, - structargs(ft.Params(), true), - structargs(ft.Results(), false)) + typecheck.NewFuncParams(ft.Params(), true), + typecheck.NewFuncParams(ft.Results(), false)) // Reuse f's types.Sym to create a new ODCLFUNC/function. - fn := dclfunc(f.Nname.Sym(), tfn) + fn := typecheck.DeclFunc(f.Nname.Sym(), tfn) fn.SetDupok(true) fn.SetWrapper(true) // ignore frame for panic+recover matching @@ -281,22 +282,22 @@ func makeABIWrapper(f *ir.Func, wrapperABI obj.ABI) { } fn.Body.Append(tail) - funcbody() + typecheck.FinishFuncBody() if base.Debug.DclStack != 0 { types.CheckDclstack() } - typecheckFunc(fn) + typecheck.Func(fn) ir.CurFunc = fn - typecheckslice(fn.Body, ctxStmt) + typecheck.Stmts(fn.Body) escapeFuncs([]*ir.Func{fn}, false) - Target.Decls = append(Target.Decls, fn) + typecheck.Target.Decls = append(typecheck.Target.Decls, fn) // Restore previous context. base.Pos = savepos - dclcontext = savedclcontext + typecheck.DeclContext = savedclcontext ir.CurFunc = savedcurfn } |