compiler: build separation runtime with clite

This commit is contained in:
Li Jie
2025-01-07 22:16:31 +08:00
parent 1172e5bdce
commit 6170973b48
316 changed files with 71331 additions and 178 deletions

View File

@@ -23,6 +23,7 @@ import (
"strconv"
"unsafe"
"github.com/goplus/llgo/compiler/internal/env"
"github.com/goplus/llgo/compiler/ssa/abi"
"github.com/goplus/llvm"
"golang.org/x/tools/go/types/typeutil"
@@ -30,7 +31,7 @@ import (
const (
PkgPython = "github.com/goplus/llgo/py"
PkgRuntime = "github.com/goplus/llgo/compiler/internal/runtime"
PkgRuntime = env.LLGoRuntimePkg + "/internal/runtime"
)
// -----------------------------------------------------------------------------
@@ -279,9 +280,16 @@ func (p Program) runtime() *types.Package {
}
func (p Program) rtNamed(name string) *types.Named {
t := p.runtime().Scope().Lookup(name).Type().(*types.Named)
t, _ = p.gocvt.cvtNamed(t)
return t
t := p.runtime().Scope().Lookup(name).Type()
for {
if alias, ok := t.(*types.Alias); ok {
t = alias.Rhs()
} else {
break
}
}
tyNamed, _ := p.gocvt.cvtNamed(t.(*types.Named))
return tyNamed
}
func (p Program) rtType(name string) Type {