diff options
author | Thomas Lively <tlively@google.com> | 2023-08-24 12:11:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 10:11:55 -0700 |
commit | 73bbbab144c4543edb70d35160cd620d3fe94539 (patch) | |
tree | 47c40a9722f73c1be24ef5a963281aca371074ca /test/example | |
parent | da8937a71e908fecfc5722594dadd3c7ec6e80be (diff) | |
download | binaryen-73bbbab144c4543edb70d35160cd620d3fe94539.tar.gz binaryen-73bbbab144c4543edb70d35160cd620d3fe94539.tar.bz2 binaryen-73bbbab144c4543edb70d35160cd620d3fe94539.zip |
Simplify and consolidate type printing (#5816)
When printing Binaryen IR, we previously generated names for unnamed heap types
based on their structure. This was useful for seeing the structure of simple
types at a glance without having to separately go look up their definitions, but
it also had two problems:
1. The same name could be generated for multiple types. The generated names did
not take into account rec group structure or finality, so types that differed
only in these properties would have the same name. Also, generated type names
were limited in length, so very large types that shared only some structure
could also end up with the same names. Using the same name for multiple types
produces incorrect and unparsable output.
2. The generated names were not useful beyond the most trivial examples. Even
with length limits, names for nontrivial types were extremely long and visually
noisy, which made reading disassembled real-world code more challenging.
Fix these problems by emitting simple indexed names for unnamed heap types
instead. This regresses readability for very simple examples, but the trade off
is worth it.
This change also reduces the number of type printing systems we have by one.
Previously we had the system in Print.cpp, but we had another, more general and
extensible system in wasm-type-printing.h and wasm-type.cpp as well. Remove the
old type printing system from Print.cpp and replace it with a much smaller use
of the new system. This requires significant refactoring of Print.cpp so that
PrintExpressionContents object now holds a reference to a parent
PrintSExpression object that holds the type name state.
This diff is very large because almost every test output changed slightly. To
minimize the diff and ease review, change the type printer in wasm-type.cpp to
behave the same as the old type printer in Print.cpp except for the differences
in name generation. These changes will be reverted in much smaller PRs in the
future to generally improve how types are printed.
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-hello-world.txt | 2 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 88 | ||||
-rw-r--r-- | test/example/c-api-multiple-tables.txt | 4 | ||||
-rw-r--r-- | test/example/c-api-unused-mem.txt | 4 | ||||
-rw-r--r-- | test/example/module-splitting.txt | 510 | ||||
-rw-r--r-- | test/example/relooper-fuzz.txt | 12 | ||||
-rw-r--r-- | test/example/relooper-fuzz1.txt | 12 | ||||
-rw-r--r-- | test/example/relooper-fuzz2.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge1.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge2.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge3.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge4.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge5.txt | 6 | ||||
-rw-r--r-- | test/example/relooper-merge6.txt | 6 | ||||
-rw-r--r-- | test/example/typeinfo.txt | 14 |
15 files changed, 344 insertions, 344 deletions
diff --git a/test/example/c-api-hello-world.txt b/test/example/c-api-hello-world.txt index 92737a9b0..4b7eb220c 100644 --- a/test/example/c-api-hello-world.txt +++ b/test/example/c-api-hello-world.txt @@ -1,5 +1,5 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32) (result i32))) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 00880f0db..eef40f8cc 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -70,23 +70,23 @@ BinaryenFeatureAll: 126975 (i32.const 0) ) (module - (type $[mut:i8] (array (mut i8))) - (type ${mut:i32} (struct (field (mut i32)))) - (type $i32_i64_f32_f64_=>_i32 (func (param i32 i64 f32 f64) (result i32))) - (type $[mut:i16] (array (mut i16))) - (type $i32_=>_none (func (param i32))) - (type $i32_f64_=>_f32 (func (param i32 f64) (result f32))) - (type $none_=>_none (func)) - (import "module" "base" (func $an-imported (type $i32_f64_=>_f32) (param i32 f64) (result f32))) + (type $0 (array (mut i8))) + (type $1 (struct (field (mut i32)))) + (type $2 (func (param i32 i64 f32 f64) (result i32))) + (type $3 (array (mut i16))) + (type $4 (func (param i32))) + (type $5 (func (param i32 f64) (result f32))) + (type $6 (func)) + (import "module" "base" (func $an-imported (type $5) (param i32 f64) (result f32))) (global $a-global i32 (i32.const 7)) (global $a-mutable-global (mut f32) (f32.const 7.5)) - (global $i8Array-global (mut (ref null $[mut:i8])) (array.new_default $[mut:i8] + (global $i8Array-global (mut (ref null $0)) (array.new_default $0 (i32.const 0) )) - (global $i16Array-global (mut (ref null $[mut:i16])) (array.new_default $[mut:i16] + (global $i16Array-global (mut (ref null $3)) (array.new_default $3 (i32.const 0) )) - (global $i32Struct-global (mut (ref null ${mut:i32})) (struct.new_default ${mut:i32})) + (global $i32Struct-global (mut (ref null $1)) (struct.new_default $1)) (global $string-global (mut stringref) (string.const "")) (memory $0 (shared 1 256)) (data $0 (i32.const 10) "hello, world") @@ -99,7 +99,7 @@ BinaryenFeatureAll: 126975 (export "mem" (memory $0)) (export "kitchen_sinker" (func "$kitchen()sinker")) (start $starter) - (func "$kitchen()sinker" (type $i32_i64_f32_f64_=>_i32) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) + (func "$kitchen()sinker" (type $2) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) (local $4 i32) (local $5 externref) (block $the-body (result i32) @@ -2034,7 +2034,7 @@ BinaryenFeatureAll: 126975 ) (drop (i32.eqz - (call_indirect $tab (type $i32_i64_f32_f64_=>_i32) + (call_indirect $tab (type $2) (i32.const 13) (i64.const 37) (f32.const 1.2999999523162842) @@ -2098,7 +2098,7 @@ BinaryenFeatureAll: 126975 (f32.const 1.2999999523162842) (f64.const 3.7) ) - (return_call_indirect $tab (type $i32_i64_f32_f64_=>_i32) + (return_call_indirect $tab (type $2) (i32.const 13) (i64.const 37) (f32.const 1.2999999523162842) @@ -2260,57 +2260,57 @@ BinaryenFeatureAll: 126975 ) ) (drop - (ref.test (ref null $[mut:i8]) + (ref.test (ref null $0) (global.get $i8Array-global) ) ) (drop - (ref.cast (ref null $[mut:i8]) + (ref.cast (ref null $0) (global.get $i8Array-global) ) ) (drop - (struct.new_default ${mut:i32}) + (struct.new_default $1) ) (drop - (struct.new ${mut:i32} + (struct.new $1 (i32.const 0) ) ) (drop - (struct.get ${mut:i32} 0 + (struct.get $1 0 (global.get $i32Struct-global) ) ) - (struct.set ${mut:i32} 0 + (struct.set $1 0 (global.get $i32Struct-global) (i32.const 0) ) (drop - (array.new_default $[mut:i8] + (array.new_default $0 (i32.const 3) ) ) (drop - (array.new $[mut:i8] + (array.new $0 (i32.const 42) (i32.const 3) ) ) (drop - (array.new_fixed $[mut:i8] 3 + (array.new_fixed $0 3 (i32.const 1) (i32.const 2) (i32.const 3) ) ) (drop - (array.get_s $[mut:i8] + (array.get_s $0 (global.get $i8Array-global) (i32.const 0) ) ) - (array.set $[mut:i8] + (array.set $0 (global.get $i8Array-global) (i32.const 0) (i32.const 42) @@ -2320,7 +2320,7 @@ BinaryenFeatureAll: 126975 (global.get $i8Array-global) ) ) - (array.copy $[mut:i8] $[mut:i8] + (array.copy $0 $0 (global.get $i8Array-global) (i32.const 0) (global.get $i8Array-global) @@ -2586,24 +2586,24 @@ BinaryenFeatureAll: 126975 (i32.const 42) ) ) - (func $starter (type $none_=>_none) + (func $starter (type $6) (nop) ) ) (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_i64 (func (result i64))) + (type $0 (func (result i32))) + (type $1 (func (result i64))) (func $unreachable-fn (result i32) - (call_indirect (type $none_=>_i64) + (call_indirect (type $1) (unreachable) ) ) ) raw: (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) + (type $0 (func)) + (type $1 (func (param i32))) + (type $2 (func (result i32))) (import "module" "check" (func $check (param i32))) (func $just-one-block (local $0 i32) @@ -3069,7 +3069,7 @@ optimized: ) module loaded from binary form: (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32) (result i32))) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) @@ -3079,7 +3079,7 @@ module loaded from binary form: ) module s-expr printed (in memory): (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32) (result i32))) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) @@ -3090,7 +3090,7 @@ module s-expr printed (in memory): module s-expr printed (in memory, caller-owned): (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32) (result i32))) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) @@ -3100,8 +3100,8 @@ module s-expr printed (in memory, caller-owned): ) (module - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) + (type $0 (func (param i32))) + (type $1 (func)) (import "spectest" "print" (func $print-i32 (param i32))) (start $starter) (func $starter @@ -3112,7 +3112,7 @@ module s-expr printed (in memory, caller-owned): ) 1234 : i32 (module - (type $none_=>_none (func)) + (type $0 (func)) (func $func (local $0 i32) (local.set $0 @@ -3122,7 +3122,7 @@ module s-expr printed (in memory, caller-owned): ) validation: 0 (module - (type $none_=>_none (func)) + (type $0 (func)) (global $a-global i32 (i32.const 125)) (memory $0 1 256) (data $0 (i32.const 10) "hello, world") @@ -3145,7 +3145,7 @@ validation: 0 ) module with a function to optimize: (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (func $adder (result i32) (i32.add (i32.const 1) @@ -3155,7 +3155,7 @@ module with a function to optimize: ) optimized: (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (func $adder (result i32) (i32.const 4) ) @@ -3169,9 +3169,9 @@ module with recursive GC types: (type $SomeArray (array (mut (ref null $SomeArray)))) (type $SomeSignature (func (param (ref null $SomeSignature) (ref null $SomeArray)) (result (ref null $SomeSignature)))) (type $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))))) - (type $none_=>_none (func)) + (type $3 (func)) (type $SomeSubStruct (sub $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))) (field $SomePackedField i8)))) - (func $test (type $none_=>_none) + (func $test (type $3) (local $0 (ref null $SomeArray)) (local $1 (ref null $SomeStruct)) (local $2 (ref null $SomeSignature)) diff --git a/test/example/c-api-multiple-tables.txt b/test/example/c-api-multiple-tables.txt index a6c5ce18a..ccb09e3ee 100644 --- a/test/example/c-api-multiple-tables.txt +++ b/test/example/c-api-multiple-tables.txt @@ -1,5 +1,5 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32) (result i32))) (table $tab 1 1 funcref) (table $table2 2 2 funcref) (elem $0 (table $tab) (i32.const 0) func $adder) @@ -12,7 +12,7 @@ ) ) (func $call_adder_indirect (param $0 i32) (param $1 i32) (result i32) - (call_indirect $t2 (type $i32_i32_=>_i32) + (call_indirect $t2 (type $0) (local.get $0) (local.get $1) (i32.const 0) diff --git a/test/example/c-api-unused-mem.txt b/test/example/c-api-unused-mem.txt index 802e7207b..36d0a9a6b 100644 --- a/test/example/c-api-unused-mem.txt +++ b/test/example/c-api-unused-mem.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 1024 1024) (export "memory" (memory $0)) (export "main" (func $main)) @@ -38,7 +38,7 @@ ) 133 (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 1024 1024) (export "memory" (memory $0)) (export "main" (func $main)) diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt index 4fb5f2862..69146cbf9 100644 --- a/test/example/module-splitting.txt +++ b/test/example/module-splitting.txt @@ -12,7 +12,7 @@ Secondary: Before: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) @@ -21,7 +21,7 @@ Before: Keeping: <none> After: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) @@ -33,7 +33,7 @@ After: ) Secondary: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (import "primary" "%memory" (memory $mem (shared 3 42))) (import "primary" "%table" (table $tab 3 42 funcref)) (import "primary" "%global" (global $glob (mut i32))) @@ -43,7 +43,7 @@ Secondary: Before: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (import "env" "mem" (memory $mem (shared 3 42))) (import "env" "tab" (table $tab 3 42 funcref)) (import "env" "glob" (global $glob (mut i32))) @@ -52,7 +52,7 @@ Before: Keeping: <none> After: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (import "env" "mem" (memory $mem (shared 3 42))) (import "env" "tab" (table $tab 3 42 funcref)) (import "env" "glob" (global $glob (mut i32))) @@ -64,7 +64,7 @@ After: ) Secondary: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (import "primary" "%memory" (memory $mem (shared 3 42))) (import "primary" "%table" (table $tab 3 42 funcref)) (import "primary" "%global" (global $glob (mut i32))) @@ -74,7 +74,7 @@ Secondary: Before: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) @@ -87,7 +87,7 @@ Before: Keeping: <none> After: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) @@ -99,7 +99,7 @@ After: ) Secondary: (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (import "primary" "mem" (memory $mem (shared 3 42))) (import "primary" "tab" (table $tab 3 42 funcref)) (import "primary" "glob" (global $glob (mut i32))) @@ -109,16 +109,16 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (type $0 (func (param i32) (result i32))) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (type $0 (func (param i32) (result i32))) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -129,18 +129,18 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -151,21 +151,21 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 1 funcref) (elem $0 (i32.const 0) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 1 funcref) (elem $0 (i32.const 0) $foo) (export "%table" (table $table)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -177,21 +177,21 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 2 funcref) (elem $0 (i32.const 0) $foo $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 2 funcref) (elem $0 (i32.const 0) $foo $foo) (export "%table" (table $table)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -203,24 +203,24 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1 funcref) (elem $0 (global.get $base) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1 funcref) (elem $0 (global.get $base) $foo) (export "%table" (table $table)) (export "%global" (global $base)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -233,24 +233,24 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 2 funcref) (elem $0 (global.get $base) $foo $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 2 funcref) (elem $0 (global.get $base) $foo $foo) (export "%table" (table $table)) (export "%global" (global $base)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -263,14 +263,14 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) ) Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) ) Secondary: (module @@ -279,8 +279,8 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) @@ -288,8 +288,8 @@ Before: Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) @@ -303,9 +303,9 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) @@ -313,9 +313,9 @@ Before: Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) - (import "env" "foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (import "env" "foo" (func $foo (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) @@ -331,8 +331,8 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (type $0 (func (param i32) (result i32))) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -342,8 +342,8 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (type $0 (func (param i32) (result i32))) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -351,23 +351,23 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "placeholder" "0" (func $placeholder_0 (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32))) (table $0 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "foo" (func $foo)) (export "%table" (table $0)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $0 (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $0 (type $0) (local.get $0) (i32.const 0) ) @@ -375,10 +375,10 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $0 1 funcref)) (elem $0 (i32.const 0) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -386,28 +386,28 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 1 funcref) (elem $0 (i32.const 0) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "placeholder" "0" (func $placeholder_0 (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32))) (table $table 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "%table" (table $table)) ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1 funcref)) (elem $0 (i32.const 0) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -415,29 +415,29 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 2 funcref) (elem $0 (i32.const 0) $foo $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "placeholder" "0" (func $placeholder_0 (type $i32_=>_i32) (param i32) (result i32))) - (import "placeholder" "1" (func $placeholder_1 (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32))) + (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32))) (table $table 2 funcref) (elem $0 (i32.const 0) $placeholder_0 $placeholder_1) (export "%table" (table $table)) ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 2 funcref)) (elem $0 (i32.const 0) $foo $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -445,25 +445,25 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (i32.const 42) $foo) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "placeholder" "42" (func $placeholder_42 (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "placeholder" "42" (func $placeholder_42 (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (i32.const 42) $placeholder_42) (export "foo" (func $foo)) (export "%table" (table $table)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $table (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $table (type $0) (local.get $0) (i32.const 42) ) @@ -471,10 +471,10 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) (elem $0 (i32.const 42) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -482,28 +482,28 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) (elem $0 (global.get $base) $foo) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) - (import "placeholder" "0" (func $placeholder_0 (type $i32_=>_i32) (param i32) (result i32))) + (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (global.get $base) $placeholder_0) (export "foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $table (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $table (type $0) (local.get $0) (global.get $base) ) @@ -511,11 +511,11 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) (elem $0 (global.get $base) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -523,29 +523,29 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) (elem $0 (global.get $base) $foo $foo) (export "foo" (func $foo)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: <none> After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) - (import "placeholder" "0" (func $placeholder_0 (type $i32_=>_i32) (param i32) (result i32))) - (import "placeholder" "1" (func $placeholder_1 (type $i32_=>_i32) (param i32) (result i32))) + (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32))) + (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (global.get $base) $placeholder_0 $placeholder_1) (export "foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $table (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $table (type $0) (local.get $0) (global.get $base) ) @@ -553,11 +553,11 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) (elem $0 (global.get $base) $foo $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -565,37 +565,37 @@ Secondary: Before: (module - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func)) + (type $1 (func (param i32) (result i32))) (import "env" "base" (global $base i32)) (table $table 1000 funcref) (elem $0 (global.get $base) $null $foo) (export "foo" (func $foo)) - (func $null (type $none_=>_none) + (func $null (type $0) (nop) ) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $1) (param $0 i32) (result i32) (local.get $0) ) ) Keeping: null After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) + (type $0 (func (param i32) (result i32))) + (type $1 (func)) (import "env" "base" (global $base i32)) - (import "placeholder" "1" (func $placeholder_1 (type $i32_=>_i32) (param i32) (result i32))) + (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32))) (table $table 1000 funcref) (elem $0 (global.get $base) $null $placeholder_1) (export "foo" (func $foo)) (export "%null" (func $null)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $null (type $none_=>_none) + (func $null (type $1) (nop) ) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $table (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $table (type $0) (local.get $0) (i32.add (global.get $base) @@ -606,13 +606,13 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) + (type $0 (func (param i32) (result i32))) + (type $1 (func)) (import "primary" "%table" (table $table 1000 funcref)) (import "primary" "%global" (global $base i32)) - (import "primary" "%null" (func $null (type $none_=>_none))) + (import "primary" "%null" (func $null (type $1))) (elem $0 (global.get $base) $null $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (local.get $0) ) ) @@ -620,22 +620,22 @@ Secondary: Before: (module - (type $none_=>_none (func)) - (func $foo (type $none_=>_none) + (type $0 (func)) + (func $foo (type $0) (call $bar) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) Keeping: bar, foo After: (module - (type $none_=>_none (func)) - (func $foo (type $none_=>_none) + (type $0 (func)) + (func $foo (type $0) (call $bar) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) @@ -646,28 +646,28 @@ Secondary: Before: (module - (type $none_=>_none (func)) - (func $foo (type $none_=>_none) + (type $0 (func)) + (func $foo (type $0) (call $bar) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) Keeping: bar After: (module - (type $none_=>_none (func)) + (type $0 (func)) (export "%bar" (func $bar)) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) - (import "primary" "%bar" (func $bar (type $none_=>_none))) - (func $foo (type $none_=>_none) + (type $0 (func)) + (import "primary" "%bar" (func $bar (type $0))) + (func $foo (type $0) (call $bar) ) ) @@ -675,34 +675,34 @@ Secondary: Before: (module - (type $none_=>_none (func)) - (func $foo (type $none_=>_none) + (type $0 (func)) + (func $foo (type $0) (call $bar) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) Keeping: foo After: (module - (type $none_=>_none (func)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) + (type $0 (func)) + (import "placeholder" "0" (func $placeholder_0 (type $0))) (table $0 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "%table" (table $0)) - (func $foo (type $none_=>_none) - (call_indirect $0 (type $none_=>_none) + (func $foo (type $0) + (call_indirect $0 (type $0) (i32.const 0) ) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $0 1 funcref)) (elem $0 (i32.const 0) $bar) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) @@ -710,11 +710,11 @@ Secondary: Before: (module - (type $none_=>_none (func)) - (func $foo (type $none_=>_none) + (type $0 (func)) + (func $foo (type $0) (call $bar) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) ) @@ -724,11 +724,11 @@ After: ) Secondary: (module - (type $none_=>_none (func)) - (func $bar (type $none_=>_none) + (type $0 (func)) + (func $bar (type $0) (nop) ) - (func $foo (type $none_=>_none) + (func $foo (type $0) (call $bar) ) ) @@ -736,41 +736,41 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (export "%foo" (func $bar)) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (call $foo) ) ) Keeping: foo After: (module - (type $none_=>_none (func)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) + (type $0 (func)) + (import "placeholder" "0" (func $placeholder_0 (type $0))) (table $0 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "%foo" (func $bar)) (export "%foo_1" (func $foo)) (export "%table" (table $0)) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) - (call_indirect $0 (type $none_=>_none) + (func $bar (type $0) + (call_indirect $0 (type $0) (i32.const 0) ) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $0 1 funcref)) - (import "primary" "%foo_1" (func $foo (type $none_=>_none))) + (import "primary" "%foo_1" (func $foo (type $0))) (elem $0 (i32.const 0) $bar) - (func $bar (type $none_=>_none) + (func $bar (type $0) (call $foo) ) ) @@ -778,48 +778,48 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (table $table 4 funcref) (elem $0 (i32.const 0) $foo $bar $baz $quux) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Keeping: bar, quux After: (module - (type $none_=>_none (func)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) - (import "placeholder" "2" (func $placeholder_2 (type $none_=>_none))) + (type $0 (func)) + (import "placeholder" "0" (func $placeholder_0 (type $0))) + (import "placeholder" "2" (func $placeholder_2 (type $0))) (table $table 4 funcref) (elem $0 (i32.const 0) $placeholder_0 $bar $placeholder_2 $quux) (export "%table" (table $table)) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $table 4 funcref)) (elem $0 (i32.const 0) $foo) (elem $1 (i32.const 2) $baz) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) ) @@ -827,53 +827,53 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) (table $table 4 funcref) (elem $0 (global.get $base) $foo $bar $baz $quux) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Keeping: bar, quux After: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) - (import "placeholder" "2" (func $placeholder_2 (type $none_=>_none))) + (import "placeholder" "0" (func $placeholder_0 (type $0))) + (import "placeholder" "2" (func $placeholder_2 (type $0))) (table $table 4 funcref) (elem $0 (global.get $base) $placeholder_0 $bar $placeholder_2 $quux) (export "%bar" (func $bar)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $table 4 funcref)) (import "primary" "%global" (global $base i32)) - (import "primary" "%bar" (func $bar (type $none_=>_none))) + (import "primary" "%bar" (func $bar (type $0))) (elem $0 (global.get $base) $foo $bar $baz) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) ) @@ -881,49 +881,49 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (table $table 4 funcref) (elem $0 (i32.const 0) $foo $bar $baz $quux) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Keeping: baz After: (module - (type $none_=>_none (func)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) - (import "placeholder" "1" (func $placeholder_1 (type $none_=>_none))) - (import "placeholder" "3" (func $placeholder_3 (type $none_=>_none))) + (type $0 (func)) + (import "placeholder" "0" (func $placeholder_0 (type $0))) + (import "placeholder" "1" (func $placeholder_1 (type $0))) + (import "placeholder" "3" (func $placeholder_3 (type $0))) (table $table 4 funcref) (elem $0 (i32.const 0) $placeholder_0 $placeholder_1 $baz $placeholder_3) (export "%table" (table $table)) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $table 4 funcref)) (elem $0 (i32.const 0) $foo $bar) (elem $1 (i32.const 3) $quux) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) @@ -931,54 +931,54 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) (table $table 4 funcref) (elem $0 (global.get $base) $foo $bar $baz $quux) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) Keeping: baz After: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) - (import "placeholder" "1" (func $placeholder_1 (type $none_=>_none))) - (import "placeholder" "3" (func $placeholder_3 (type $none_=>_none))) + (import "placeholder" "0" (func $placeholder_0 (type $0))) + (import "placeholder" "1" (func $placeholder_1 (type $0))) + (import "placeholder" "3" (func $placeholder_3 (type $0))) (table $table 4 funcref) (elem $0 (global.get $base) $placeholder_0 $placeholder_1 $baz $placeholder_3) (export "%baz" (func $baz)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $baz (type $none_=>_none) + (func $baz (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $table 4 funcref)) (import "primary" "%global" (global $base i32)) - (import "primary" "%baz" (func $baz (type $none_=>_none))) + (import "primary" "%baz" (func $baz (type $0))) (elem $0 (global.get $base) $foo $bar $baz $quux) - (func $bar (type $none_=>_none) + (func $bar (type $0) (nop) ) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $quux (type $none_=>_none) + (func $quux (type $0) (nop) ) ) @@ -986,40 +986,40 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) (table $table 2 funcref) (elem $0 (global.get $base) $foo $bar) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) - (func $bar (type $none_=>_none) + (func $bar (type $0) (call $foo) ) ) Keeping: foo After: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "base" (global $base i32)) - (import "placeholder" "1" (func $placeholder_1 (type $none_=>_none))) + (import "placeholder" "1" (func $placeholder_1 (type $0))) (table $table 2 funcref) (elem $0 (global.get $base) $foo $placeholder_1) (export "%foo" (func $foo)) (export "%table" (table $table)) (export "%global" (global $base)) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $table 2 funcref)) (import "primary" "%global" (global $base i32)) - (import "primary" "%foo" (func $foo (type $none_=>_none))) + (import "primary" "%foo" (func $foo (type $0))) (elem $0 (global.get $base) $foo $bar) - (func $bar (type $none_=>_none) + (func $bar (type $0) (call $foo) ) ) @@ -1027,15 +1027,15 @@ Secondary: Before: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (table $table 1 1 funcref) (elem $0 (i32.const 0) $foo) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) + (func $foo (type $0) (param $0 i32) (result i32) (call $bar (i32.const 0) ) ) - (func $bar (type $i32_=>_i32) (param $0 i32) (result i32) + (func $bar (type $0) (param $0 i32) (result i32) (call $foo (i32.const 1) ) @@ -1044,14 +1044,14 @@ Before: Keeping: foo After: (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (import "placeholder" "1" (func $placeholder_1 (type $i32_=>_i32) (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) + (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32))) (table $table 2 2 funcref) (elem $0 (i32.const 0) $foo $placeholder_1) (export "%foo" (func $foo)) (export "%table" (table $table)) - (func $foo (type $i32_=>_i32) (param $0 i32) (result i32) - (call_indirect $table (type $i32_=>_i32) + (func $foo (type $0) (param $0 i32) (result i32) + (call_indirect $table (type $0) (i32.const 0) (i32.const 1) ) @@ -1059,11 +1059,11 @@ After: ) Secondary: (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (import "primary" "%table" (table $table 2 2 funcref)) - (import "primary" "%foo" (func $foo (type $i32_=>_i32) (param i32) (result i32))) + (import "primary" "%foo" (func $foo (type $0) (param i32) (result i32))) (elem $0 (i32.const 1) $bar) - (func $bar (type $i32_=>_i32) (param $0 i32) (result i32) + (func $bar (type $0) (param $0 i32) (result i32) (call $foo (i32.const 1) ) @@ -1073,35 +1073,35 @@ Secondary: Before: (module - (type $none_=>_none (func)) + (type $0 (func)) (export "foo1" (func $foo)) (export "foo2" (func $foo)) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) ) Keeping: <none> After: (module - (type $none_=>_none (func)) - (import "placeholder" "0" (func $placeholder_0 (type $none_=>_none))) + (type $0 (func)) + (import "placeholder" "0" (func $placeholder_0 (type $0))) (table $0 1 funcref) (elem $0 (i32.const 0) $placeholder_0) (export "foo1" (func $foo)) (export "foo2" (func $foo)) (export "%table" (table $0)) - (func $foo (type $none_=>_none) - (call_indirect $0 (type $none_=>_none) + (func $foo (type $0) + (call_indirect $0 (type $0) (i32.const 0) ) ) ) Secondary: (module - (type $none_=>_none (func)) + (type $0 (func)) (import "primary" "%table" (table $0 1 funcref)) (elem $0 (i32.const 0) $foo) - (func $foo (type $none_=>_none) + (func $foo (type $0) (nop) ) ) @@ -1109,7 +1109,7 @@ Secondary: Minimized names primary: (module - (type $none_=>_none (func)) + (type $0 (func)) (export "already_exported" (func $3)) (export "%b" (func $7)) (export "%a" (func $0)) @@ -1120,52 +1120,52 @@ Minimized names primary: (export "%g" (func $6)) (export "%h" (func $8)) (export "%i" (func $9)) - (func $0 (type $none_=>_none) + (func $0 (type $0) (nop) ) - (func $1 (type $none_=>_none) + (func $1 (type $0) (nop) ) - (func $2 (type $none_=>_none) + (func $2 (type $0) (nop) ) - (func $3 (type $none_=>_none) + (func $3 (type $0) (nop) ) - (func $4 (type $none_=>_none) + (func $4 (type $0) (nop) ) - (func $5 (type $none_=>_none) + (func $5 (type $0) (nop) ) - (func $6 (type $none_=>_none) + (func $6 (type $0) (nop) ) - (func $7 (type $none_=>_none) + (func $7 (type $0) (nop) ) - (func $8 (type $none_=>_none) + (func $8 (type $0) (nop) ) - (func $9 (type $none_=>_none) + (func $9 (type $0) (nop) ) ) Minimized names secondary: (module - (type $none_=>_none (func)) - (import "primary" "%a" (func $0 (type $none_=>_none))) - (import "primary" "%c" (func $1 (type $none_=>_none))) - (import "primary" "%d" (func $2 (type $none_=>_none))) - (import "primary" "already_exported" (func $3 (type $none_=>_none))) - (import "primary" "%e" (func $4 (type $none_=>_none))) - (import "primary" "%f" (func $5 (type $none_=>_none))) - (import "primary" "%g" (func $6 (type $none_=>_none))) - (import "primary" "%b" (func $7 (type $none_=>_none))) - (import "primary" "%h" (func $8 (type $none_=>_none))) - (import "primary" "%i" (func $9 (type $none_=>_none))) - (func $call (type $none_=>_none) + (type $0 (func)) + (import "primary" "%a" (func $0 (type $0))) + (import "primary" "%c" (func $1 (type $0))) + (import "primary" "%d" (func $2 (type $0))) + (import "primary" "already_exported" (func $3 (type $0))) + (import "primary" "%e" (func $4 (type $0))) + (import "primary" "%f" (func $5 (type $0))) + (import "primary" "%g" (func $6 (type $0))) + (import "primary" "%b" (func $7 (type $0))) + (import "primary" "%h" (func $8 (type $0))) + (import "primary" "%i" (func $9 (type $0))) + (func $call (type $0) (call $0) (call $1) (call $2) diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt index c21f72695..c962a3e0a 100644 --- a/test/example/relooper-fuzz.txt +++ b/test/example/relooper-fuzz.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) @@ -292,9 +292,9 @@ ) ) (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt index 641771432..1fb24808e 100644 --- a/test/example/relooper-fuzz1.txt +++ b/test/example/relooper-fuzz1.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) @@ -268,9 +268,9 @@ ) ) (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-fuzz2.txt b/test/example/relooper-fuzz2.txt index 493cc8e34..bee8277d7 100644 --- a/test/example/relooper-fuzz2.txt +++ b/test/example/relooper-fuzz2.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge1.txt b/test/example/relooper-merge1.txt index 5846d1697..1d5779259 100644 --- a/test/example/relooper-merge1.txt +++ b/test/example/relooper-merge1.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge2.txt b/test/example/relooper-merge2.txt index 899f12a4d..31a13192d 100644 --- a/test/example/relooper-merge2.txt +++ b/test/example/relooper-merge2.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge3.txt b/test/example/relooper-merge3.txt index ff6d89c82..a856d10b0 100644 --- a/test/example/relooper-merge3.txt +++ b/test/example/relooper-merge3.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge4.txt b/test/example/relooper-merge4.txt index 59392aad8..6f0f7d5b3 100644 --- a/test/example/relooper-merge4.txt +++ b/test/example/relooper-merge4.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge5.txt b/test/example/relooper-merge5.txt index 5d3156e72..c09c016b9 100644 --- a/test/example/relooper-merge5.txt +++ b/test/example/relooper-merge5.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/relooper-merge6.txt b/test/example/relooper-merge6.txt index e6f5f4627..dca86d40a 100644 --- a/test/example/relooper-merge6.txt +++ b/test/example/relooper-merge6.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (result i32))) + (type $1 (func)) + (type $2 (func (param i32))) (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) (export "mem" (memory $0)) diff --git a/test/example/typeinfo.txt b/test/example/typeinfo.txt index a20fc2bfa..33b234666 100644 --- a/test/example/typeinfo.txt +++ b/test/example/typeinfo.txt @@ -12,7 +12,7 @@ i31 i31ref (ref i31) (func) -(type $struct.0 (struct)) +(type $struct.0 (struct )) (type $array.0 (array i32)) ;; Signature @@ -24,10 +24,10 @@ i31ref (ref null $func.0) ;; Struct -(struct) +(type $struct.0 (struct )) (ref $struct.0) (ref null $struct.0) -(struct (field i32 i64 (mut f32) (mut f64))) +(type $struct.0 (struct (field i32) (field i64) (field (mut f32)) (field (mut f64)))) (ref $struct.0) (ref null $struct.0) @@ -52,16 +52,16 @@ none (func (param (ref null $struct.0) (ref $array.0)) (result (ref $struct.0) (ref null $array.1))) ;; Struct of references -(struct (field (ref $func.0) (mut (ref $func.0)) (ref null $func.0) (mut (ref null $func.0)))) +(type $struct.0 (struct (field (ref $func.0)) (field (mut (ref $func.0))) (field (ref null $func.0)) (field (mut (ref null $func.0))))) (ref $struct.0) (ref null $struct.0) -(struct (field (ref $struct.0) (mut (ref $struct.0)) (ref null $struct.0) (mut (ref null $struct.0)))) +(type $struct.0 (struct (field (ref $struct.1)) (field (mut (ref $struct.1))) (field (ref null $struct.1)) (field (mut (ref null $struct.1))))) (ref $struct.0) (ref null $struct.0) -(struct (field (ref $array.0) (mut (ref $array.0)) (ref null $array.0) (mut (ref null $array.0)))) +(type $struct.0 (struct (field (ref $array.0)) (field (mut (ref $array.0))) (field (ref null $array.0)) (field (mut (ref null $array.0))))) (ref $struct.0) (ref null $struct.0) -(struct (field (mut i32) (mut (ref null $func.0)) (mut (ref null $struct.0)) (mut (ref null $array.0)))) +(type $struct.0 (struct (field (mut i32)) (field (mut (ref null $func.0))) (field (mut (ref null $struct.1))) (field (mut (ref null $array.0))))) (ref $struct.0) (ref null $struct.0) |