diff --git a/src/cmd/compile/internal/gc/compile.go b/src/cmd/compile/internal/gc/compile.go index a8a0106320..6e347bf0f1 100644 --- a/src/cmd/compile/internal/gc/compile.go +++ b/src/cmd/compile/internal/gc/compile.go @@ -13,7 +13,6 @@ import ( "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/liveness" - "cmd/compile/internal/reflectdata" "cmd/compile/internal/ssagen" "cmd/compile/internal/typecheck" "cmd/compile/internal/types" @@ -84,21 +83,6 @@ func prepareFunc(fn *ir.Func) { walk.Walk(fn) ir.CurFunc = nil // enforce no further uses of CurFunc typecheck.DeclContext = ir.PEXTERN - - // Make sure type syms are declared for all types that might - // be types of stack objects. We need to do this here - // because symbols must be allocated before the parallel - // phase of the compiler. - for _, n := range fn.Dcl { - if liveness.ShouldTrack(n) && n.Addrtaken() { - reflectdata.WriteType(n.Type()) - // Also make sure we allocate a linker symbol - // for the stack object data, for the same reason. - if fn.LSym.Func().StackObjects == nil { - fn.LSym.Func().StackObjects = base.Ctxt.Lookup(fn.LSym.Name + ".stkobj") - } - } - } } // compileFunctions compiles all functions in compilequeue. diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index fe9a1f617b..c48ac22d2a 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -6494,7 +6494,8 @@ func emitStackObjects(e *ssafn, pp *objw.Progs) { // Populate the stack object data. // Format must match runtime/stack.go:stackObjectRecord. - x := e.curfn.LSym.Func().StackObjects + x := base.Ctxt.Lookup(e.curfn.LSym.Name + ".stkobj") + e.curfn.LSym.Func().StackObjects = x off := 0 off = objw.Uintptr(x, off, uint64(len(vars))) for _, v := range vars { @@ -6502,10 +6503,7 @@ func emitStackObjects(e *ssafn, pp *objw.Progs) { // in which case the offset is relative to argp. // Locals have a negative Xoffset, in which case the offset is relative to varp. off = objw.Uintptr(x, off, uint64(v.FrameOffset())) - if !types.TypeSym(v.Type()).Siggen() { - e.Fatalf(v.Pos(), "stack object's type symbol not generated for type %s", v.Type()) - } - off = objw.SymPtr(x, off, reflectdata.WriteType(v.Type()), 0) + off = objw.SymPtr(x, off, reflectdata.TypeLinksym(v.Type()), 0) } // Emit a funcdata pointing at the stack object data.