]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: minor rulegen simplifications
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 18 Apr 2020 16:34:00 +0000 (17:34 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 26 Apr 2020 20:15:41 +0000 (20:15 +0000)
commit6a569f243e028f823a9f20bfd9da7bdfab8699a4
tree9d8032b7004d73ecdb581620a3836ef4af83a5fc
parent8bcf2834afdf6a1f7937390903a41518715ef6f5
cmd/compile: minor rulegen simplifications

The commuteDepth variable is no longer necessary; remove it.

Else branches after a log.Fatal call are unnecessary.

Also make the unbalanced return an integer, so we can differentiate
positive from negative cases. We only want to continue a rule with the
following lines if this balance is positive, for example.

While at it, make the balance loop stop when it goes negative, to not
let ")(" seem balanced.

Change-Id: I8aa313343ca5a2f07f638b62a0398fdf108fc9eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/228822
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/gen/rulegen.go