builder: build SSA before compiling packages

This commit is contained in:
Jake Bailey
2026-08-07 19:52:19 -07:00
committed by Damian Gryski
parent 570a3deac2
commit c33682cf00
4 changed files with 18 additions and 7 deletions
+3 -1
View File
@@ -224,7 +224,9 @@ func compileGoFileForTesting(t *testing.T, filename string) llvm.Module {
// Compile AST to IR.
program := lprogram.LoadSSA()
pkg := lprogram.MainPkg()
mod, errs := compiler.CompilePackage(filename, pkg, program.Package(pkg.Pkg), machine, compilerConfig, false)
ssaPkg := program.Package(pkg.Pkg)
ssaPkg.Build()
mod, errs := compiler.CompilePackage(filename, pkg, ssaPkg, machine, compilerConfig, false)
if errs != nil {
for _, err := range errs {
t.Error(err)