mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: add types2.Sizes implementation
This CL adds an implementation of types2.Sizes that calculates sizes using the same sizing algorithm as cmd/compile. In particular, it matches how cmd/compile pads structures and includes padding in size calculations. Change-Id: I4dd8e51f95c90f9d7bd1e7463e40edcd3955a219 Reviewed-on: https://go-review.googlesource.com/c/go/+/282915 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
44d1a8523a
commit
2e8f29b79d
2 changed files with 151 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ func ParseFiles(filenames []string) (lines uint) {
|
|||
return os.Open(file)
|
||||
},
|
||||
},
|
||||
Sizes: &gcSizes{},
|
||||
}
|
||||
info := types2.Info{
|
||||
Types: make(map[syntax.Expr]types2.TypeAndValue),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue