aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/noder.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-01-08 19:27:51 -0800
committerMatthew Dempsky <mdempsky@google.com>2021-01-11 19:59:28 +0000
commit2e8f29b79d4bce097ebe0c822b469d4714657395 (patch)
tree76ca4b0b9c7bd61b1dc700330284a50282ec09db /src/cmd/compile/internal/noder/noder.go
parent44d1a8523a50c30354e0b1ef70953567c26eed1a (diff)
downloadgo-2e8f29b79d4bce097ebe0c822b469d4714657395.tar.gz
go-2e8f29b79d4bce097ebe0c822b469d4714657395.zip
[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>
Diffstat (limited to 'src/cmd/compile/internal/noder/noder.go')
-rw-r--r--src/cmd/compile/internal/noder/noder.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go
index 938ffe05ce..099e3a6956 100644
--- a/src/cmd/compile/internal/noder/noder.go
+++ b/src/cmd/compile/internal/noder/noder.go
@@ -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),