mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] all: merge dev.regabi (d1d1099) into dev.typeparams
Merge List:
* 2020-12-23 d1d1099c91 [dev.regabi] cmd/compile: fixes for big rewrite
Change-Id: I245471cf78138eb7848c747002e2eb47c287065b
This commit is contained in:
commit
23922cf83b
2 changed files with 12 additions and 9 deletions
|
|
@ -265,20 +265,21 @@ func makeABIWrapper(f *ir.Func, wrapperABI obj.ABI) {
|
||||||
// to allocate any stack space). Doing this will require some
|
// to allocate any stack space). Doing this will require some
|
||||||
// extra work in typecheck/walk/ssa, might want to add a new node
|
// extra work in typecheck/walk/ssa, might want to add a new node
|
||||||
// OTAILCALL or something to this effect.
|
// OTAILCALL or something to this effect.
|
||||||
var call ir.Node
|
var tail ir.Node
|
||||||
if tfn.Type().NumResults() == 0 && tfn.Type().NumParams() == 0 && tfn.Type().NumRecvs() == 0 {
|
if tfn.Type().NumResults() == 0 && tfn.Type().NumParams() == 0 && tfn.Type().NumRecvs() == 0 {
|
||||||
call = nodSym(ir.ORETJMP, nil, f.Nname.Sym())
|
tail = nodSym(ir.ORETJMP, nil, f.Nname.Sym())
|
||||||
} else {
|
} else {
|
||||||
call = ir.Nod(ir.OCALL, f.Nname, nil)
|
call := ir.Nod(ir.OCALL, f.Nname, nil)
|
||||||
call.PtrList().Set(paramNnames(tfn.Type()))
|
call.PtrList().Set(paramNnames(tfn.Type()))
|
||||||
call.SetIsDDD(tfn.Type().IsVariadic())
|
call.SetIsDDD(tfn.Type().IsVariadic())
|
||||||
|
tail = call
|
||||||
if tfn.Type().NumResults() > 0 {
|
if tfn.Type().NumResults() > 0 {
|
||||||
n := ir.Nod(ir.ORETURN, nil, nil)
|
n := ir.Nod(ir.ORETURN, nil, nil)
|
||||||
n.PtrList().Set1(call)
|
n.PtrList().Set1(call)
|
||||||
call = n
|
tail = n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn.PtrBody().Append(call)
|
fn.PtrBody().Append(tail)
|
||||||
|
|
||||||
funcbody()
|
funcbody()
|
||||||
if base.Debug.DclStack != 0 {
|
if base.Debug.DclStack != 0 {
|
||||||
|
|
|
||||||
|
|
@ -7332,18 +7332,20 @@ func callTargetLSym(callee *types.Sym, callerLSym *obj.LSym) *obj.LSym {
|
||||||
if ir.AsNode(callee.Def) == nil {
|
if ir.AsNode(callee.Def) == nil {
|
||||||
return lsym
|
return lsym
|
||||||
}
|
}
|
||||||
ndclfunc := ir.AsNode(callee.Def).Name().Defn
|
defn := ir.AsNode(callee.Def).Name().Defn
|
||||||
if ndclfunc == nil {
|
if defn == nil {
|
||||||
return lsym
|
return lsym
|
||||||
}
|
}
|
||||||
|
ndclfunc := defn.(*ir.Func)
|
||||||
|
|
||||||
// check for case 1 above
|
// check for case 1 above
|
||||||
if callerLSym.ABIWrapper() {
|
if callerLSym.ABIWrapper() {
|
||||||
if nlsym := ndclfunc.Func().LSym; nlsym != nil {
|
if nlsym := ndclfunc.LSym; nlsym != nil {
|
||||||
lsym = nlsym
|
lsym = nlsym
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// check for case 2 above
|
// check for case 2 above
|
||||||
nam := ndclfunc.Func().Nname
|
nam := ndclfunc.Nname
|
||||||
defABI, hasDefABI := symabiDefs[nam.Sym().LinksymName()]
|
defABI, hasDefABI := symabiDefs[nam.Sym().LinksymName()]
|
||||||
if hasDefABI && defABI == obj.ABI0 {
|
if hasDefABI && defABI == obj.ABI0 {
|
||||||
lsym = nam.Sym().LinksymABI0()
|
lsym = nam.Sym().LinksymABI0()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue