mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
compiler: refactor when the optsize attribute is set
This commit has a few related changes:
* It sets the optsize attribute immediately in the compiler instead of
adding it to each function afterwards in a loop. This seems to me
like the more appropriate way to do it.
* It centralizes setting the optsize attribute in the transform
package, to make later changes easier.
* It sets the optsize in a few more places: to runtime.initAll and to
WebAssembly i64 wrappers.
This commit does not affect the binary size of any of the smoke tests,
so should be risk-free.
This commit is contained in:
committed by
Ron Evans
parent
1869efe954
commit
d7b7583e83
@@ -3,6 +3,7 @@ package transform_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/tinygo-org/tinygo/compileopts"
|
||||
"github.com/tinygo-org/tinygo/transform"
|
||||
"tinygo.org/x/go-llvm"
|
||||
)
|
||||
@@ -11,7 +12,7 @@ func TestWasmABI(t *testing.T) {
|
||||
t.Parallel()
|
||||
testTransform(t, "testdata/wasm-abi", func(mod llvm.Module) {
|
||||
// Run ABI change pass.
|
||||
err := transform.ExternalInt64AsPtr(mod)
|
||||
err := transform.ExternalInt64AsPtr(mod, &compileopts.Config{Options: &compileopts.Options{Opt: "2"}})
|
||||
if err != nil {
|
||||
t.Errorf("failed to change wasm ABI: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user