aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/reader.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-06-21 02:29:49 -0700
committerMatthew Dempsky <mdempsky@google.com>2022-06-23 21:52:53 +0000
commit3d432b6c4b86a5fcd1ccce0f914193b8e0e9e79e (patch)
tree1e1d4e6f45323123c5271a010efc135da75a0f27 /src/cmd/compile/internal/noder/reader.go
parent7368647ac6eecd57a476616ff1f3ac1aa7f445b6 (diff)
downloadgo-3d432b6c4b86a5fcd1ccce0f914193b8e0e9e79e.tar.xz
[dev.unified] cmd/compile: plumb rtype through for OMAPLIT
OMAPLIT gets lowered into a bunch of OINDEXMAP operations, which in general may require a *runtime._type argument. This CL adds CompLitExpr.RType, updates the GOEXPERIMENT=unified frontend to start setting it, and updates walk to propagate it through to any generated OINDEXMAP operations. Change-Id: I278e7e8e615ea6d01f65a5eba6d6fc8e00045735 Reviewed-on: https://go-review.googlesource.com/c/go/+/413360 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/reader.go')
-rw-r--r--src/cmd/compile/internal/noder/reader.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go
index 7588e52d96..32276e7553 100644
--- a/src/cmd/compile/internal/noder/reader.go
+++ b/src/cmd/compile/internal/noder/reader.go
@@ -1812,6 +1812,11 @@ func (r *reader) compLit() ir.Node {
}
lit := typecheck.Expr(ir.NewCompLitExpr(pos, ir.OCOMPLIT, typ, elems))
+ switch lit.Op() {
+ case ir.OMAPLIT:
+ lit := lit.(*ir.CompLitExpr)
+ lit.RType = reflectdata.TypePtrAt(pos, typ)
+ }
if typ0.IsPtr() {
lit = typecheck.Expr(typecheck.NodAddrAt(pos, lit))
lit.SetType(typ0)