125 lines
4.5 KiB
Plaintext
125 lines
4.5 KiB
Plaintext
|
|
(component
|
||
|
|
(type $ty-foo (;0;)
|
||
|
|
(instance
|
||
|
|
(type (;0;) (func (result string)))
|
||
|
|
(export (;0;) "a" (func (type 0)))
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(import "foo" (instance $foo (;0;) (type $ty-foo)))
|
||
|
|
(core module $main (;0;)
|
||
|
|
(type (;0;) (func (param i32)))
|
||
|
|
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
|
||
|
|
(type (;2;) (func (param i32 i32) (result i32)))
|
||
|
|
(type (;3;) (func))
|
||
|
|
(type (;4;) (func (result i32)))
|
||
|
|
(import "foo" "a" (func (;0;) (type 0)))
|
||
|
|
(memory (;0;) 1)
|
||
|
|
(export "memory" (memory 0))
|
||
|
|
(export "cabi_realloc" (func 1))
|
||
|
|
(export "a" (func 2))
|
||
|
|
(export "cabi_post_a" (func 3))
|
||
|
|
(export "bar#a" (func 4))
|
||
|
|
(export "bar#b" (func 5))
|
||
|
|
(export "cabi_post_bar#b" (func 6))
|
||
|
|
(func (;1;) (type 1) (param i32 i32 i32 i32) (result i32)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(func (;2;) (type 2) (param i32 i32) (result i32)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(func (;3;) (type 0) (param i32)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(func (;4;) (type 3)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(func (;5;) (type 4) (result i32)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(func (;6;) (type 0) (param i32)
|
||
|
|
unreachable
|
||
|
|
)
|
||
|
|
(@producers
|
||
|
|
(processed-by "wit-component" "$CARGO_PKG_VERSION")
|
||
|
|
(processed-by "my-fake-bindgen" "123.45")
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(core module $wit-component-shim-module (;1;)
|
||
|
|
(type (;0;) (func (param i32)))
|
||
|
|
(table (;0;) 1 1 funcref)
|
||
|
|
(export "0" (func $indirect-foo-a))
|
||
|
|
(export "$imports" (table 0))
|
||
|
|
(func $indirect-foo-a (;0;) (type 0) (param i32)
|
||
|
|
local.get 0
|
||
|
|
i32.const 0
|
||
|
|
call_indirect (type 0)
|
||
|
|
)
|
||
|
|
(@producers
|
||
|
|
(processed-by "wit-component" "$CARGO_PKG_VERSION")
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(core module $wit-component-fixup (;2;)
|
||
|
|
(type (;0;) (func (param i32)))
|
||
|
|
(import "" "0" (func (;0;) (type 0)))
|
||
|
|
(import "" "$imports" (table (;0;) 1 1 funcref))
|
||
|
|
(elem (;0;) (i32.const 0) func 0)
|
||
|
|
(@producers
|
||
|
|
(processed-by "wit-component" "$CARGO_PKG_VERSION")
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(core instance $wit-component-shim-instance (;0;) (instantiate $wit-component-shim-module))
|
||
|
|
(alias core export $wit-component-shim-instance "0" (core func $indirect-foo-a (;0;)))
|
||
|
|
(core instance $foo (;1;)
|
||
|
|
(export "a" (func $indirect-foo-a))
|
||
|
|
)
|
||
|
|
(core instance $main (;2;) (instantiate $main
|
||
|
|
(with "foo" (instance $foo))
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(alias core export $main "memory" (core memory $memory (;0;)))
|
||
|
|
(alias core export $wit-component-shim-instance "$imports" (core table $"shim table" (;0;)))
|
||
|
|
(alias export $foo "a" (func $a (;0;)))
|
||
|
|
(alias core export $main "cabi_realloc" (core func $realloc (;1;)))
|
||
|
|
(core func $"#core-func2 indirect-foo-a" (@name "indirect-foo-a") (;2;) (canon lower (func $a) (memory $memory) (realloc $realloc) string-encoding=utf8))
|
||
|
|
(core instance $fixup-args (;3;)
|
||
|
|
(export "$imports" (table $"shim table"))
|
||
|
|
(export "0" (func $"#core-func2 indirect-foo-a"))
|
||
|
|
)
|
||
|
|
(core instance $fixup (;4;) (instantiate $wit-component-fixup
|
||
|
|
(with "" (instance $fixup-args))
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(type (;1;) (tuple string u32 string))
|
||
|
|
(type (;2;) (func (param "x" string) (result 1)))
|
||
|
|
(alias core export $main "a" (core func $a (;3;)))
|
||
|
|
(alias core export $main "cabi_post_a" (core func $cabi_post_a (;4;)))
|
||
|
|
(func $"#func1 a" (@name "a") (;1;) (type 2) (canon lift (core func $a) (memory $memory) (realloc $realloc) string-encoding=utf8 (post-return $cabi_post_a)))
|
||
|
|
(export $"#func2 a" (@name "a") (;2;) "a" (func $"#func1 a"))
|
||
|
|
(type (;3;) (func))
|
||
|
|
(alias core export $main "bar#a" (core func $bar#a (;5;)))
|
||
|
|
(func $"#func3 a" (@name "a") (;3;) (type 3) (canon lift (core func $bar#a)))
|
||
|
|
(type (;4;) (func (result string)))
|
||
|
|
(alias core export $main "bar#b" (core func $bar#b (;6;)))
|
||
|
|
(alias core export $main "cabi_post_bar#b" (core func $cabi_post_bar#b (;7;)))
|
||
|
|
(func $b (;4;) (type 4) (canon lift (core func $bar#b) (memory $memory) string-encoding=utf8 (post-return $cabi_post_bar#b)))
|
||
|
|
(component $bar-shim-component (;0;)
|
||
|
|
(type (;0;) (func))
|
||
|
|
(import "import-func-a" (func (;0;) (type 0)))
|
||
|
|
(type (;1;) (func (result string)))
|
||
|
|
(import "import-func-b" (func (;1;) (type 1)))
|
||
|
|
(type (;2;) (func))
|
||
|
|
(export (;2;) "a" (func 0) (func (type 2)))
|
||
|
|
(type (;3;) (func (result string)))
|
||
|
|
(export (;3;) "b" (func 1) (func (type 3)))
|
||
|
|
)
|
||
|
|
(instance $bar-shim-instance (;1;) (instantiate $bar-shim-component
|
||
|
|
(with "import-func-a" (func $"#func3 a"))
|
||
|
|
(with "import-func-b" (func $b))
|
||
|
|
)
|
||
|
|
)
|
||
|
|
(export $bar (;2;) "bar" (instance $bar-shim-instance))
|
||
|
|
(@producers
|
||
|
|
(processed-by "wit-component" "$CARGO_PKG_VERSION")
|
||
|
|
)
|
||
|
|
)
|