NewPackage: altSSA

This commit is contained in:
xushiwei
2024-06-15 12:10:08 +08:00
parent fa712aa3a0
commit e0a25b5098
5 changed files with 10 additions and 5 deletions

View File

@@ -365,7 +365,12 @@ func buildPkg(prog llssa.Program, aPkg *aPackage, mode Mode, verbose bool) {
pkg.ExportFile = ""
return
}
ret, err := cl.NewPackage(prog, aPkg.SSA, pkg.Syntax)
syntax := pkg.Syntax
if altPkg := aPkg.AltPkg; altPkg != nil {
// TODO: merge pkg.Types
syntax = append(syntax, altPkg.Syntax...)
}
ret, err := cl.NewPackage(prog, aPkg.SSA, aPkg.AltSSA, syntax)
check(err)
if needLLFile(mode) {
pkg.ExportFile += ".ll"