mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/internal/ssa: SSA cleanups
Mostly suggested by Alan. Convert Const* ops to just one Const op. Use more of go/types. Get rid of typers, all types must be specified explicitly. Change-Id: Id4758f2b887d8a6888e88a7e047d97af55e34b62 Reviewed-on: https://go-review.googlesource.com/8110 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
7b96284295
commit
2c9b491e01
16 changed files with 269 additions and 172 deletions
|
|
@ -20,7 +20,7 @@ func deadcode(f *Func) {
|
|||
|
||||
// constant-fold conditionals
|
||||
// TODO: rewrite rules instead?
|
||||
if b.Kind == BlockIf && b.Control.Op == OpConstBool {
|
||||
if b.Kind == BlockIf && b.Control.Op == OpConst {
|
||||
cond := b.Control.Aux.(bool)
|
||||
var c *Block
|
||||
if cond {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue