mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
all: move bootstrapping IR to Go runtime
This has the benefit of not requiring a 'runtime' IR file, so that complete relocatable files can be built without requiring input IR. This makes the compiler a lot easier to use without the Makefile. Code size is not affected.
This commit is contained in:
@@ -30,13 +30,15 @@ func Compile(pkgName, runtimePath, outpath, target string, printIR, dumpSSA bool
|
||||
}
|
||||
|
||||
// Add C/LLVM runtime.
|
||||
runtime, err := llvm.ParseBitcodeFile(runtimePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = c.LinkModule(runtime)
|
||||
if err != nil {
|
||||
return err
|
||||
if runtimePath != "" {
|
||||
runtime, err := llvm.ParseBitcodeFile(runtimePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = c.LinkModule(runtime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Compile Go code to IR.
|
||||
|
||||
Reference in New Issue
Block a user