]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: minor code cleanup
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 5 Sep 2015 00:33:32 +0000 (17:33 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sat, 5 Sep 2015 02:25:25 +0000 (02:25 +0000)
Change-Id: I9c84f5ca18745fb2358494c6944bf7ddd05cf8f0
Reviewed-on: https://go-review.googlesource.com/14332
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/ssa/check.go

index 710b7609c628135b55b9b1b0c50f8659d3b95d76..4b38bec99edee2d612256f4fe905dae85b287aa1 100644 (file)
@@ -122,16 +122,9 @@ func checkFunc(f *Func) {
                }
 
                for _, v := range b.Values {
-
-                       if _, ok := v.Aux.(bool); ok {
-                               f.Fatalf("value %v has a bool Aux value, should be AuxInt", v.LongString())
-                       }
-                       if _, ok := v.Aux.(float32); ok {
-                               f.Fatalf("value %v has a float32 Aux value, should be AuxInt", v.LongString())
-                       }
-
-                       if _, ok := v.Aux.(float64); ok {
-                               f.Fatalf("value %v has a float64 Aux value, should be AuxInt", v.LongString())
+                       switch v.Aux.(type) {
+                       case bool, float32, float64:
+                               f.Fatalf("value %v has an Aux value of type %T, should be AuxInt", v.LongString(), v.Aux)
                        }
 
                        for _, arg := range v.Args {