diff options
Diffstat (limited to 'src/cmd/compile/internal/gc/universe.go')
-rw-r--r-- | src/cmd/compile/internal/gc/universe.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/gc/universe.go b/src/cmd/compile/internal/gc/universe.go index b7472ede0f..5d59fdbbc5 100644 --- a/src/cmd/compile/internal/gc/universe.go +++ b/src/cmd/compile/internal/gc/universe.go @@ -77,17 +77,17 @@ var unsafeFuncs = [...]struct { // initUniverse initializes the universe block. func initUniverse() { - if Widthptr == 0 { + if types.PtrSize == 0 { base.Fatalf("typeinit before betypeinit") } - slicePtrOffset = 0 - sliceLenOffset = Rnd(slicePtrOffset+int64(Widthptr), int64(Widthptr)) - sliceCapOffset = Rnd(sliceLenOffset+int64(Widthptr), int64(Widthptr)) - sizeofSlice = Rnd(sliceCapOffset+int64(Widthptr), int64(Widthptr)) + types.SlicePtrOffset = 0 + types.SliceLenOffset = types.Rnd(types.SlicePtrOffset+int64(types.PtrSize), int64(types.PtrSize)) + types.SliceCapOffset = types.Rnd(types.SliceLenOffset+int64(types.PtrSize), int64(types.PtrSize)) + types.SliceSize = types.Rnd(types.SliceCapOffset+int64(types.PtrSize), int64(types.PtrSize)) // string is same as slice wo the cap - sizeofString = Rnd(sliceLenOffset+int64(Widthptr), int64(Widthptr)) + types.StringSize = types.Rnd(types.SliceLenOffset+int64(types.PtrSize), int64(types.PtrSize)) for et := types.Kind(0); et < types.NTYPE; et++ { types.SimType[et] = et @@ -103,7 +103,7 @@ func initUniverse() { n.SetType(t) sym.Def = n if kind != types.TANY { - dowidth(t) + types.CalcSize(t) } return t } @@ -114,7 +114,7 @@ func initUniverse() { for _, s := range &typedefs { sameas := s.sameas32 - if Widthptr == 8 { + if types.PtrSize == 8 { sameas = s.sameas64 } types.SimType[s.etype] = sameas @@ -139,7 +139,7 @@ func initUniverse() { types.ErrorType.SetUnderlying(makeErrorInterface()) n.SetType(types.ErrorType) s.Def = n - dowidth(types.ErrorType) + types.CalcSize(types.ErrorType) types.Types[types.TUNSAFEPTR] = defBasic(types.TUNSAFEPTR, ir.Pkgs.Unsafe, "Pointer") |