go.tools/ssa/interp: use new Sizes interface (fix build)

R=adonovan
TBR=adonovan
CC=golang-dev
https://golang.org/cl/14722043
This commit is contained in:
Robert Griesemer 2013-10-15 15:30:03 -07:00
parent 5fcdb7b3ff
commit d8391b87d1
2 changed files with 4 additions and 2 deletions

View File

@ -613,6 +613,8 @@ func setGlobal(i *interpreter, pkg *ssa.Package, name string, v value) {
panic("no global variable: " + pkg.Object.Path() + "." + name)
}
var stdSizes = types.StdSizes{WordSize: 8, MaxAlign: 8}
// Interpret interprets the Go program whose main package is mainpkg.
// mode specifies various interpreter options. filename and args are
// the initial values of os.Args for the target program.
@ -659,7 +661,7 @@ func Interpret(mainpkg *ssa.Package, mode Mode, filename string, args []string)
case "runtime":
// (Assumes no custom Sizeof used during SSA construction.)
sz := types.DefaultSizeof(pkg.Object.Scope().Lookup("MemStats").Type())
sz := stdSizes.Sizeof(pkg.Object.Scope().Lookup("MemStats").Type())
setGlobal(i, pkg, "sizeof_C_MStats", uintptr(sz))
case "os":

View File

@ -162,7 +162,7 @@ func ext۰reflect۰rtype۰Out(fn *ssa.Function, args []value) value {
func ext۰reflect۰rtype۰Size(fn *ssa.Function, args []value) value {
// Signature: func (t reflect.rtype) uintptr
// (Assumes no custom Sizeof used during SSA construction.)
return uintptr(types.DefaultSizeof(args[0].(rtype).t))
return uintptr(stdSizes.Sizeof(args[0].(rtype).t))
}
func ext۰reflect۰rtype۰String(fn *ssa.Function, args []value) value {