cmd/compile: change Oconv to take an Op parameter

Eliminates type conversions in a bunch of Oconv(int(n.Op), ...) calls.

Notably, this identified a misuse of Oconv in amd64/gsubr.go to try to
print an assembly instruction op instead of a compiler node op.

Change-Id: I93b5aa49fe14a5eaf868b05426d3b8cd8ab52bc5
Reviewed-on: https://go-review.googlesource.com/20298
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2016-03-07 08:23:55 -08:00
parent 0de0cafb9f
commit c3dfad5df9
29 changed files with 117 additions and 117 deletions

View file

@ -91,7 +91,7 @@ func optoas(op gc.Op, t *gc.Type) int {
a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default:
gc.Fatalf("optoas: no entry %v-%v", gc.Oconv(int(op), 0), t)
gc.Fatalf("optoas: no entry %v-%v", gc.Oconv(op, 0), t)
case OADDR_ | gc.TPTR32:
a = x86.ALEAL
@ -454,7 +454,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) int {
if !gc.Thearch.Use387 {
switch uint32(op)<<16 | uint32(et) {
default:
gc.Fatalf("foptoas-sse: no entry %v-%v", gc.Oconv(int(op), 0), t)
gc.Fatalf("foptoas-sse: no entry %v-%v", gc.Oconv(op, 0), t)
case OCMP_ | gc.TFLOAT32:
a = x86.AUCOMISS
@ -587,7 +587,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) int {
return x86.AFCHS
}
gc.Fatalf("foptoas %v %v %#x", gc.Oconv(int(op), 0), t, flg)
gc.Fatalf("foptoas %v %v %#x", gc.Oconv(op, 0), t, flg)
return 0
}