diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 503dc449d3..368fe1fcab 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -210,13 +210,7 @@ func Main(archInit func(*Arch)) { // initialize types package // (we need to do this to break dependencies that otherwise // would lead to import cycles) - types.Widthptr = Widthptr - types.Dowidth = dowidth - types.TypeLinkSym = func(t *types.Type) *obj.LSym { - return typenamesym(t).Linksym() - } - - initUniverse() + initializeTypesPackage() dclcontext = ir.PEXTERN @@ -1125,3 +1119,13 @@ func parseLang(s string) (lang, error) { } return lang{major: major, minor: minor}, nil } + +func initializeTypesPackage() { + types.Widthptr = Widthptr + types.Dowidth = dowidth + types.TypeLinkSym = func(t *types.Type) *obj.LSym { + return typenamesym(t).Linksym() + } + + initUniverse() +}