]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses
authorMatthew Dempsky <mdempsky@google.com>
Tue, 21 Jun 2022 09:30:21 +0000 (02:30 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 23 Jun 2022 21:53:09 +0000 (21:53 +0000)
commit61ae2b734cdbc0db342036a2a026fe1fccdccde3
treef84dc5dc6bc118472573f53d0ac276ec04320f8f
parent3d432b6c4b86a5fcd1ccce0f914193b8e0e9e79e
[dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses

For (value) switch statements, we may generate OEQ comparisons between
values of interface and concrete type, which in turn may require
access to the concrete type's RType.

To plumb this through, this CL adds CaseClause.RTypes to hold the
rtype values, updates the GOEXPERIMENT=unified frontend to set it, and
updates walk to plumb rtypes through into generated OEQ nodes.

Change-Id: I6f1de2a1167ce54f5770147498a0a591efb3f012
Reviewed-on: https://go-review.googlesource.com/c/go/+/413361
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/ir/stmt.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/reflectdata/helpers.go
src/cmd/compile/internal/walk/switch.go