llgo/ssa: rtType, rtFunc

This commit is contained in:
xushiwei
2024-04-27 17:39:25 +08:00
parent f1761c0c9c
commit 6a02c3ac4c
14 changed files with 259 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ package build
import (
"fmt"
"go/token"
"go/types"
"log"
"os"
"os/exec"
@@ -112,6 +113,11 @@ func Do(args []string, conf *Config) {
}
prog := llssa.NewProgram(nil)
prog.SetRuntime(func() *types.Package {
rt, err := packages.Load(cfg, "github.com/goplus/llgo/internal/runtime")
check(err)
return rt[0].Types
})
mode := conf.Mode
if mode == ModeBuild && len(initial) == 1 {
mode = ModeInstall