]> Cypherpunks repositories - gostls13.git/commit
go/types: fix sizeof computations
authorRobert Griesemer <gri@golang.org>
Tue, 26 Feb 2013 06:06:58 +0000 (22:06 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 26 Feb 2013 06:06:58 +0000 (22:06 -0800)
commita5e42f2611e0daae92a699091ce8c6525e9dc5e9
tree8915460d8ed1663c90e9809498599c4c94d86420
parent3f132a82365f49cda015b8c3ac694947d3ca54ae
go/types: fix sizeof computations

Context.Alignof/Offsetsof/Sizeof now provide means
to customize the type checker for a given platform.

- provide Context.Offsetsof to specify the
  offsets of struct fields
- use the correct sizes for ints, uint, uintptrs
  in constant computations
- moved all size computations into separate file
  (sizes.go)
- fixed a bug with string constant slicing

R=adonovan, axwalk
CC=golang-dev
https://golang.org/cl/7363054
16 files changed:
src/pkg/exp/ssa/importer.go
src/pkg/go/types/api.go
src/pkg/go/types/builtins.go
src/pkg/go/types/check.go
src/pkg/go/types/const.go
src/pkg/go/types/conversions.go
src/pkg/go/types/expr.go
src/pkg/go/types/gcimporter.go
src/pkg/go/types/gcimporter_test.go
src/pkg/go/types/operand.go
src/pkg/go/types/sizes.go [new file with mode: 0644]
src/pkg/go/types/stmt.go
src/pkg/go/types/testdata/builtins.src
src/pkg/go/types/testdata/decls1.src
src/pkg/go/types/testdata/expr3.src
src/pkg/go/types/types.go