diff options
author | Keith Randall <khr@golang.org> | 2016-03-31 21:24:10 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2016-04-11 17:11:23 +0000 |
commit | b04e145248d5d3721a41d4bb26704fdb43caaf38 (patch) | |
tree | 2179b4c4ebef5291e8bdf4e1bdedb760543d9bd3 /src/cmd/compile/internal/ssa/export_test.go | |
parent | 6c6089b3fdba9eb0cff863a03074dbac47c92f63 (diff) | |
download | go-b04e145248d5d3721a41d4bb26704fdb43caaf38.tar.gz go-b04e145248d5d3721a41d4bb26704fdb43caaf38.zip |
cmd/compile: fix naming of decomposed structs
When a struct is SSAable, we will name its component parts
by their field names. For example,
type T struct {
a, b, c int
}
If we ever need to spill a variable x of type T, we will
spill its individual components to variables named x.a, x.b,
and x.c.
Change-Id: I857286ff1f2597f2c4bbd7b4c0b936386fb37131
Reviewed-on: https://go-review.googlesource.com/21389
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index ce577ef055..0a67de9f05 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -48,6 +48,9 @@ func (d DummyFrontend) SplitComplex(s LocalSlot) (LocalSlot, LocalSlot) { } return LocalSlot{s.N, d.TypeFloat32(), s.Off}, LocalSlot{s.N, d.TypeFloat32(), s.Off + 4} } +func (d DummyFrontend) SplitStruct(s LocalSlot, i int) LocalSlot { + return LocalSlot{s.N, s.Type.FieldType(i), s.Off + s.Type.FieldOff(i)} +} func (DummyFrontend) Line(line int32) string { return "unknown.go:0" } |