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
|
|
@ -477,9 +477,9 @@ func (p *exporter) typ(t *Type) {
|
|||
|
||||
for _, m := range methods {
|
||||
p.string(m.Sym.Name)
|
||||
p.paramList(getthisx(m.Type))
|
||||
p.paramList(getinargx(m.Type))
|
||||
p.paramList(getoutargx(m.Type))
|
||||
p.paramList(m.Type.Recv())
|
||||
p.paramList(m.Type.Params())
|
||||
p.paramList(m.Type.Results())
|
||||
p.inlinedBody(m.Type.Nname)
|
||||
|
||||
if p.trace && m.Down != nil {
|
||||
|
|
@ -521,8 +521,8 @@ func (p *exporter) typ(t *Type) {
|
|||
|
||||
case TFUNC:
|
||||
p.tag(signatureTag)
|
||||
p.paramList(getinargx(t))
|
||||
p.paramList(getoutargx(t))
|
||||
p.paramList(t.Params())
|
||||
p.paramList(t.Results())
|
||||
|
||||
case TINTER:
|
||||
p.tag(interfaceTag)
|
||||
|
|
@ -609,8 +609,8 @@ func (p *exporter) method(m *Type) {
|
|||
// TODO(gri) For functions signatures, we use p.typ() to export
|
||||
// so we could share the same type with multiple functions. Do
|
||||
// the same here, or never try to do this for functions.
|
||||
p.paramList(getinargx(m.Type))
|
||||
p.paramList(getoutargx(m.Type))
|
||||
p.paramList(m.Type.Params())
|
||||
p.paramList(m.Type.Results())
|
||||
}
|
||||
|
||||
// fieldName is like qualifiedName but it doesn't record the package
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue