llgo/ssa: checkExpr to auto convert funcPtr into closure

This commit is contained in:
xushiwei
2024-05-04 17:25:13 +08:00
parent 9f25d73826
commit c0ef1598c9
7 changed files with 52 additions and 58 deletions

View File

@@ -19,6 +19,7 @@ package ssa
import (
"bytes"
"fmt"
"go/types"
"log"
"github.com/goplus/llvm"
@@ -102,7 +103,8 @@ func (b Builder) Return(results ...Expr) {
case 1:
b.impl.CreateRet(results[0].impl)
default:
b.impl.CreateAggregateRet(llvmValues(results))
tret := b.fn.t.(*types.Signature).Results()
b.impl.CreateAggregateRet(llvmValues(results, tret, b))
}
}