ssa: add llgo:link support to Builder.abiMthd

This commit is contained in:
Aofei Sheng
2024-08-03 08:35:19 +08:00
parent 0bd259403c
commit 482f796bad
4 changed files with 87 additions and 0 deletions

View File

@@ -154,6 +154,9 @@ func (b Builder) abiMethodOf(mPkg *types.Package, mName string, mSig *types.Sign
func (b Builder) abiMthd(mPkg *types.Package, mName string, mSig *types.Signature, name, abiTyp, ifn llvm.Value) (ret Expr, tfn llvm.Value) {
fullName := FuncName(mPkg, mName, mSig.Recv())
if b.Pkg.fnlink != nil {
fullName = b.Pkg.fnlink(fullName)
}
tfn = b.Pkg.NewFunc(fullName, mSig, InGo).impl // TODO(xsw): use rawType to speed up
if ifn.IsNil() {
ifn = tfn