mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.unified] cmd/compile: visit LHS before RHS/X in assign/for statement
Unified IR used to visit RHS/X before LHS in assign/for statements for satisfying toolstash in quirksmode. After CL 385998, unified IR quirks mode was gone, the constraint to visit RHS/X first is no longer necessary. Change-Id: I1c3825168b67fb094928f5aa21748a3c81b118ce Reviewed-on: https://go-review.googlesource.com/c/go/+/410343 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
46ddf0873e
commit
9e5c968021
2 changed files with 5 additions and 9 deletions
|
|
@ -1224,10 +1224,8 @@ func (r *reader) stmt1(tag codeStmt, out *ir.Nodes) ir.Node {
|
|||
case stmtAssign:
|
||||
pos := r.pos()
|
||||
|
||||
// TODO(mdempsky): After quirks mode is gone, swap these
|
||||
// statements so we visit LHS before RHS again.
|
||||
rhs := r.exprList()
|
||||
names, lhs := r.assignList()
|
||||
rhs := r.exprList()
|
||||
|
||||
if len(rhs) == 0 {
|
||||
for _, name := range names {
|
||||
|
|
@ -1368,10 +1366,8 @@ func (r *reader) forStmt(label *types.Sym) ir.Node {
|
|||
if r.Bool() {
|
||||
pos := r.pos()
|
||||
|
||||
// TODO(mdempsky): After quirks mode is gone, swap these
|
||||
// statements so we read LHS before X again.
|
||||
x := r.expr()
|
||||
names, lhs := r.assignList()
|
||||
x := r.expr()
|
||||
|
||||
body := r.blockStmt()
|
||||
r.closeAnotherScope()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue