]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix format verbs in ssa package
authorKeith Randall <khr@golang.org>
Fri, 16 Sep 2016 23:56:29 +0000 (16:56 -0700)
committerKeith Randall <khr@golang.org>
Sat, 17 Sep 2016 02:54:11 +0000 (02:54 +0000)
%s is no longer valid.  Use %v instead.

Change-Id: I5ec4fa6a9280082c1a0c75fd1cf94b4bb8096f5c
Reviewed-on: https://go-review.googlesource.com/29365
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/location.go
src/cmd/compile/internal/ssa/value.go

index b6de3ea0645e53e9b82ed5781858c5d849b5e5aa..f9eaedf092920e3d9c22847dbabe9e948b226086 100644 (file)
@@ -33,9 +33,9 @@ type LocalSlot struct {
 
 func (s LocalSlot) Name() string {
        if s.Off == 0 {
-               return fmt.Sprintf("%s[%s]", s.N, s.Type)
+               return fmt.Sprintf("%v[%v]", s.N, s.Type)
        }
-       return fmt.Sprintf("%s+%d[%s]", s.N, s.Off, s.Type)
+       return fmt.Sprintf("%v+%d[%v]", s.N, s.Off, s.Type)
 }
 
 type LocPair [2]Location
index 71955aaddd100a96c0644abe82e63dc648dcee82..b53e41cf28dd8ef5aa8f89325763d22c04b1758a 100644 (file)
@@ -97,7 +97,7 @@ func (v *Value) AuxValAndOff() ValAndOff {
 
 // long form print.  v# = opcode <type> [aux] args [: reg]
 func (v *Value) LongString() string {
-       s := fmt.Sprintf("v%d = %s", v.ID, v.Op.String())
+       s := fmt.Sprintf("v%d = %s", v.ID, v.Op)
        s += " <" + v.Type.String() + ">"
        s += v.auxString()
        for _, a := range v.Args {
@@ -134,12 +134,12 @@ func (v *Value) auxString() string {
                return fmt.Sprintf(" {%q}", v.Aux)
        case auxSym:
                if v.Aux != nil {
-                       return fmt.Sprintf(" {%s}", v.Aux)
+                       return fmt.Sprintf(" {%v}", v.Aux)
                }
        case auxSymOff, auxSymInt32:
                s := ""
                if v.Aux != nil {
-                       s = fmt.Sprintf(" {%s}", v.Aux)
+                       s = fmt.Sprintf(" {%v}", v.Aux)
                }
                if v.AuxInt != 0 {
                        s += fmt.Sprintf(" [%v]", v.AuxInt)
@@ -148,7 +148,7 @@ func (v *Value) auxString() string {
        case auxSymValAndOff:
                s := ""
                if v.Aux != nil {
-                       s = fmt.Sprintf(" {%s}", v.Aux)
+                       s = fmt.Sprintf(" {%v}", v.Aux)
                }
                return s + fmt.Sprintf(" [%s]", v.AuxValAndOff())
        }