]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove BlockDead state
authorKeith Randall <khr@golang.org>
Thu, 28 Apr 2016 22:04:10 +0000 (15:04 -0700)
committerKeith Randall <khr@golang.org>
Thu, 28 Apr 2016 23:32:24 +0000 (23:32 +0000)
It is unused, remove the clutter.

Change-Id: I51a44326b125ef79241459c463441f76a289cc08
Reviewed-on: https://go-review.googlesource.com/22586
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/check.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewrite.go

index 4a10606d3c78a4ca1d42f54f76dc80b01e6bf24b..af123d83d6e7ff97a44c89ccb15ea6a26f16f57d 100644 (file)
@@ -85,19 +85,6 @@ func checkFunc(f *Func) {
                        if b.Aux == nil {
                                f.Fatalf("retjmp block %s has nil Aux field", b)
                        }
-               case BlockDead:
-                       if len(b.Succs) != 0 {
-                               f.Fatalf("dead block %s has successors", b)
-                       }
-                       if len(b.Preds) != 0 {
-                               f.Fatalf("dead block %s has predecessors", b)
-                       }
-                       if len(b.Values) != 0 {
-                               f.Fatalf("dead block %s has values", b)
-                       }
-                       if b.Control != nil {
-                               f.Fatalf("dead block %s has a control value", b)
-                       }
                case BlockPlain:
                        if len(b.Succs) != 1 {
                                f.Fatalf("plain block %s len(Succs)==%d, want 1", b, len(b.Succs))
index 88ae8b189d0d974b70cadb2101059b2dcd59a421..8ea04c4fe532ef154e5ac588dd847e526b6e0b3a 100644 (file)
@@ -438,9 +438,8 @@ var genericBlocks = []blockData{
        {name: "RetJmp"}, // no successors, jumps to b.Aux.(*gc.Sym)
        {name: "Exit"},   // no successors, control value generates a panic
 
-       // transient block states used for dead code removal
+       // transient block state used for dead code removal
        {name: "First"}, // 2 successors, always takes the first one (second is dead)
-       {name: "Dead"},  // no successors; determined to be dead but not yet removed
 }
 
 func init() {
index 9ab9be769c7f045cf6584eab609153b03d1377da..2795d973336543923f6d276417fe1041c36d89a4 100644 (file)
@@ -47,7 +47,6 @@ const (
        BlockRetJmp
        BlockExit
        BlockFirst
-       BlockDead
 )
 
 var blockString = [...]string{
@@ -88,7 +87,6 @@ var blockString = [...]string{
        BlockRetJmp: "RetJmp",
        BlockExit:   "Exit",
        BlockFirst:  "First",
-       BlockDead:   "Dead",
 }
 
 func (k BlockKind) String() string { return blockString[k] }
index f8a6d27d39f6cadb8add29dc9d3cc52e11688dc1..c127e85e21530689b2e6bbf797c3403ab89bf87e 100644 (file)
@@ -26,9 +26,6 @@ func applyRewrite(f *Func, rb func(*Block) bool, rv func(*Value, *Config) bool)
        for {
                change := false
                for _, b := range f.Blocks {
-                       if b.Kind == BlockDead {
-                               continue
-                       }
                        if b.Control != nil && b.Control.Op == OpCopy {
                                for b.Control.Op == OpCopy {
                                        b.SetControl(b.Control.Args[0])