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
|
|
@ -155,12 +155,12 @@ func emitptrargsmap() {
|
|||
var xoffset int64
|
||||
if Curfn.Type.Thistuple > 0 {
|
||||
xoffset = 0
|
||||
onebitwalktype1(getthisx(Curfn.Type), &xoffset, bv)
|
||||
onebitwalktype1(Curfn.Type.Recv(), &xoffset, bv)
|
||||
}
|
||||
|
||||
if Curfn.Type.Intuple > 0 {
|
||||
xoffset = 0
|
||||
onebitwalktype1(getinargx(Curfn.Type), &xoffset, bv)
|
||||
onebitwalktype1(Curfn.Type.Params(), &xoffset, bv)
|
||||
}
|
||||
|
||||
for j := 0; int32(j) < bv.n; j += 32 {
|
||||
|
|
@ -168,7 +168,7 @@ func emitptrargsmap() {
|
|||
}
|
||||
if Curfn.Type.Outtuple > 0 {
|
||||
xoffset = 0
|
||||
onebitwalktype1(getoutargx(Curfn.Type), &xoffset, bv)
|
||||
onebitwalktype1(Curfn.Type.Results(), &xoffset, bv)
|
||||
for j := 0; int32(j) < bv.n; j += 32 {
|
||||
off = duint32(sym, off, bv.b[j/32])
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ func compile(fn *Node) {
|
|||
|
||||
if Curfn.Type.Outnamed {
|
||||
// add clearing of the output parameters
|
||||
for t, it := IterFields(getoutargx(Curfn.Type)); t != nil; t = it.Next() {
|
||||
for t, it := IterFields(Curfn.Type.Results()); t != nil; t = it.Next() {
|
||||
if t.Nname != nil {
|
||||
n := Nod(OAS, t.Nname, nil)
|
||||
typecheck(&n, Etop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue