compiler: move wasm ABI workaround to transform package

By considering this as a regular transformation, it can be easily
tested.
This commit is contained in:
Ayke van Laethem
2019-12-07 23:01:20 +01:00
committed by Ron Evans
parent 91299b6466
commit 4d79d473c4
6 changed files with 248 additions and 133 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ import (
"github.com/tinygo-org/tinygo/compiler"
"github.com/tinygo-org/tinygo/goenv"
"github.com/tinygo-org/tinygo/interp"
"github.com/tinygo-org/tinygo/transform"
)
// Build performs a single package to executable Go build. It takes in a package
@@ -61,7 +62,7 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(stri
// stack-allocated values.
// Use -wasm-abi=generic to disable this behaviour.
if config.Options.WasmAbi == "js" && strings.HasPrefix(config.Triple(), "wasm") {
err := c.ExternalInt64AsPtr()
err := transform.ExternalInt64AsPtr(c.Module())
if err != nil {
return err
}