mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-01 01:27:46 +00:00
Compare commits
1 Commits
dev
...
race-debug
| Author | SHA1 | Date | |
|---|---|---|---|
| 43e104e675 |
+11
-3
@@ -243,6 +243,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
// Create the *ssa.Program. This does not yet build the entire SSA of the
|
// Create the *ssa.Program. This does not yet build the entire SSA of the
|
||||||
// program so it's pretty fast and doesn't need to be parallelized.
|
// program so it's pretty fast and doesn't need to be parallelized.
|
||||||
program := lprogram.LoadSSA()
|
program := lprogram.LoadSSA()
|
||||||
|
program.Build()
|
||||||
|
|
||||||
// Add jobs to compile each package.
|
// Add jobs to compile each package.
|
||||||
// Packages that have a cache hit will not be compiled again.
|
// Packages that have a cache hit will not be compiled again.
|
||||||
@@ -354,8 +355,8 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
packageActionIDJobs[pkg.ImportPath] = packageActionIDJob
|
packageActionIDJobs[pkg.ImportPath] = packageActionIDJob
|
||||||
|
|
||||||
// Build the SSA for the given package.
|
// Build the SSA for the given package.
|
||||||
ssaPkg := program.Package(pkg.Pkg)
|
//ssaPkg := program.Package(pkg.Pkg)
|
||||||
ssaPkg.Build()
|
//ssaPkg.Build()
|
||||||
|
|
||||||
// Now create the job to actually build the package. It will exit early
|
// Now create the job to actually build the package. It will exit early
|
||||||
// if the package is already compiled.
|
// if the package is already compiled.
|
||||||
@@ -370,7 +371,12 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
|
|
||||||
if _, err := os.Stat(job.result); err == nil {
|
if _, err := os.Stat(job.result); err == nil {
|
||||||
// Already cached, don't recreate this package.
|
// Already cached, don't recreate this package.
|
||||||
return nil
|
switch pkg.ImportPath {
|
||||||
|
case "context": // seems to be needed
|
||||||
|
case "time": // often crashes in this package, so probably needed
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile AST to IR. The compiler.CompilePackage function will
|
// Compile AST to IR. The compiler.CompilePackage function will
|
||||||
@@ -517,6 +523,8 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
run: func(*compileJob) error {
|
run: func(*compileJob) error {
|
||||||
// Load and link all the bitcode files. This does not yet optimize
|
// Load and link all the bitcode files. This does not yet optimize
|
||||||
// anything, it only links the bitcode files together.
|
// anything, it only links the bitcode files together.
|
||||||
|
println("exit")
|
||||||
|
os.Exit(0)
|
||||||
ctx := llvm.NewContext()
|
ctx := llvm.NewContext()
|
||||||
mod = ctx.NewModule("main")
|
mod = ctx.NewModule("main")
|
||||||
for _, pkgJob := range packageJobs {
|
for _, pkgJob := range packageJobs {
|
||||||
|
|||||||
Reference in New Issue
Block a user