mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: change get{this,inarg,outarg}x? into methods
More idiomatic naming (in particular, matches the naming used for go/types.Signature). Also, convert more code to use these methods and/or IterFields. (Still more to go; only made a quick pass for low hanging fruit.) Passes toolstash -cmp. Change-Id: I61831bfb1ec2cd50d4c7efc6062bca4e0dcf267b Reviewed-on: https://go-review.googlesource.com/20451 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
8df733bd22
commit
db506fe98c
21 changed files with 158 additions and 210 deletions
|
|
@ -615,12 +615,12 @@ func typefmt(t *Type, flag int) string {
|
|||
} else {
|
||||
if t.Thistuple != 0 {
|
||||
buf.WriteString("method")
|
||||
buf.WriteString(Tconv(getthisx(t), 0))
|
||||
buf.WriteString(Tconv(t.Recv(), 0))
|
||||
buf.WriteString(" ")
|
||||
}
|
||||
buf.WriteString("func")
|
||||
}
|
||||
buf.WriteString(Tconv(getinargx(t), 0))
|
||||
buf.WriteString(Tconv(t.Params(), 0))
|
||||
|
||||
switch t.Outtuple {
|
||||
case 0:
|
||||
|
|
@ -629,14 +629,14 @@ func typefmt(t *Type, flag int) string {
|
|||
case 1:
|
||||
if fmtmode != FExp {
|
||||
buf.WriteString(" ")
|
||||
buf.WriteString(Tconv(getoutargx(t).Type.Type, 0)) // struct->field->field's type
|
||||
buf.WriteString(Tconv(t.Results().Type.Type, 0)) // struct->field->field's type
|
||||
break
|
||||
}
|
||||
fallthrough
|
||||
|
||||
default:
|
||||
buf.WriteString(" ")
|
||||
buf.WriteString(Tconv(getoutargx(t), 0))
|
||||
buf.WriteString(Tconv(t.Results(), 0))
|
||||
}
|
||||
return buf.String()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue