mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use Node.Right for OAS2* nodes (cleanup)
This CL changes cmd/compile to use Node.Right instead of Node.Rlist for OAS2FUNC/OAS2RECV/OAS2MAPR/OAS2DOTTYPE nodes. Fixes #32293 Change-Id: I4c9d9100be2d98d15e016797f934f64d385f5faa Reviewed-on: https://go-review.googlesource.com/c/go/+/197817 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
9748e64fe5
commit
c729116332
12 changed files with 55 additions and 52 deletions
|
|
@ -580,6 +580,12 @@ func inlnode(n *Node, maxCost int32) *Node {
|
|||
if n.Right != nil && n.Right.Op == OINLCALL {
|
||||
if n.Op == OFOR || n.Op == OFORUNTIL {
|
||||
inlconv2stmt(n.Right)
|
||||
} else if n.Op == OAS2FUNC {
|
||||
n.Rlist.Set(inlconv2list(n.Right))
|
||||
n.Right = nil
|
||||
n.Op = OAS2
|
||||
n.SetTypecheck(0)
|
||||
n = typecheck(n, ctxStmt)
|
||||
} else {
|
||||
n.Right = inlconv2expr(n.Right)
|
||||
}
|
||||
|
|
@ -602,20 +608,13 @@ func inlnode(n *Node, maxCost int32) *Node {
|
|||
}
|
||||
|
||||
inlnodelist(n.Rlist, maxCost)
|
||||
if n.Op == OAS2FUNC && n.Rlist.First().Op == OINLCALL {
|
||||
n.Rlist.Set(inlconv2list(n.Rlist.First()))
|
||||
n.Op = OAS2
|
||||
n.SetTypecheck(0)
|
||||
n = typecheck(n, ctxStmt)
|
||||
} else {
|
||||
s := n.Rlist.Slice()
|
||||
for i1, n1 := range s {
|
||||
if n1.Op == OINLCALL {
|
||||
if n.Op == OIF {
|
||||
inlconv2stmt(n1)
|
||||
} else {
|
||||
s[i1] = inlconv2expr(s[i1])
|
||||
}
|
||||
s := n.Rlist.Slice()
|
||||
for i1, n1 := range s {
|
||||
if n1.Op == OINLCALL {
|
||||
if n.Op == OIF {
|
||||
inlconv2stmt(n1)
|
||||
} else {
|
||||
s[i1] = inlconv2expr(s[i1])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue