Debian Codegraph @

crates/wit-component/tests/components/import-in-adapter-and-main-module/component.wat

raw
1 (component
2 (type (;0;)
3 (instance
4 (type (;0;) (func))
5 (export (;0;) "f1" (func (type 0)))
6 (export (;1;) "f2" (func (type 0)))
7 (export (;2;) "f3" (func (type 0)))
8 (type (;1;) (func (result string)))
9 (export (;3;) "g1" (func (type 1)))
10 (export (;4;) "g2" (func (type 1)))
11 (export (;5;) "g3" (func (type 1)))
12 )
13 )
14 (import "foo:shared-dependency/doc" (instance (;0;) (type 0)))
15 (type (;1;)
16 (instance
17 (type (;0;) u32)
18 (export (;1;) "a-typedef" (type (eq 0)))
19 )
20 )
21 (import "foo:shared-dependency/types" (instance (;1;) (type 1)))
22 (alias export 1 "a-typedef" (type (;2;)))
23 (type (;3;)
24 (instance
25 (alias outer 1 2 (type (;0;)))
26 (export (;1;) "a-typedef" (type (eq 0)))
27 (type (;2;) (func (result 1)))
28 (export (;0;) "foo" (func (type 2)))
29 )
30 )
31 (import "main-dep" (instance (;2;) (type 3)))
32 (alias export 1 "a-typedef" (type (;4;)))
33 (type (;5;)
34 (instance
35 (alias outer 1 4 (type (;0;)))
36 (export (;1;) "a-typedef" (type (eq 0)))
37 (type (;2;) (func (result 1)))
38 (export (;0;) "foo" (func (type 2)))
39 )
40 )
41 (import "adapter-dep" (instance (;3;) (type 5)))
42 (core module (;0;)
43 (type (;0;) (func))
44 (type (;1;) (func (param i32)))
45 (type (;2;) (func (result i32)))
46 (type (;3;) (func (param i32 i32 i32 i32) (result i32)))
47 (import "foo:shared-dependency/doc" "f1" (func (;0;) (type 0)))
48 (import "foo:shared-dependency/doc" "f2" (func (;1;) (type 0)))
49 (import "foo:shared-dependency/doc" "g1" (func (;2;) (type 1)))
50 (import "foo:shared-dependency/doc" "g2" (func (;3;) (type 1)))
51 (import "old" "adapter-f1" (func (;4;) (type 0)))
52 (import "main-dep" "foo" (func (;5;) (type 2)))
53 (memory (;0;) 1)
54 (export "memory" (memory 0))
55 (export "cabi_realloc" (func 6))
56 (func (;6;) (type 3) (param i32 i32 i32 i32) (result i32)
57 unreachable
58 )
59 (@producers
60 (processed-by "wit-component" "$CARGO_PKG_VERSION")
61 (processed-by "my-fake-bindgen" "123.45")
62 )
63 )
64 (core module (;1;)
65 (type (;0;) (func))
66 (type (;1;) (func (param i32)))
67 (type (;2;) (func (result i32)))
68 (type (;3;) (func (param i32 i32 i32 i32) (result i32)))
69 (import "foo:shared-dependency/doc" "f1" (func $f1 (;0;) (type 0)))
70 (import "foo:shared-dependency/doc" "f3" (func $f3 (;1;) (type 0)))
71 (import "foo:shared-dependency/doc" "g1" (func $g1 (;2;) (type 1)))
72 (import "foo:shared-dependency/doc" "g3" (func $g3 (;3;) (type 1)))
73 (import "adapter-dep" "foo" (func $foo (;4;) (type 2)))
74 (export "adapter-f1" (func 5))
75 (export "cabi_import_realloc" (func 6))
76 (func (;5;) (type 0)
77 call $f1
78 call $f3
79 i32.const 0
80 call $g1
81 i32.const 0
82 call $g3
83 call $foo
84 drop
85 )
86 (func (;6;) (type 3) (param i32 i32 i32 i32) (result i32)
87 unreachable
88 )
89 )
90 (core module (;2;)
91 (type (;0;) (func (param i32)))
92 (type (;1;) (func))
93 (table (;0;) 5 5 funcref)
94 (export "0" (func $indirect-foo:shared-dependency/doc-g1))
95 (export "1" (func $indirect-foo:shared-dependency/doc-g2))
96 (export "2" (func $adapt-old-adapter-f1))
97 (export "3" (func $"#func3 indirect-foo:shared-dependency/doc-g1"))
98 (export "4" (func $indirect-foo:shared-dependency/doc-g3))
99 (export "$imports" (table 0))
100 (func $indirect-foo:shared-dependency/doc-g1 (;0;) (type 0) (param i32)
101 local.get 0
102 i32.const 0
103 call_indirect (type 0)
104 )
105 (func $indirect-foo:shared-dependency/doc-g2 (;1;) (type 0) (param i32)
106 local.get 0
107 i32.const 1
108 call_indirect (type 0)
109 )
110 (func $adapt-old-adapter-f1 (;2;) (type 1)
111 i32.const 2
112 call_indirect (type 1)
113 )
114 (func $"#func3 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;3;) (type 0) (param i32)
115 local.get 0
116 i32.const 3
117 call_indirect (type 0)
118 )
119 (func $indirect-foo:shared-dependency/doc-g3 (;4;) (type 0) (param i32)
120 local.get 0
121 i32.const 4
122 call_indirect (type 0)
123 )
124 (@producers
125 (processed-by "wit-component" "$CARGO_PKG_VERSION")
126 )
127 )
128 (core module (;3;)
129 (type (;0;) (func (param i32)))
130 (type (;1;) (func))
131 (import "" "0" (func (;0;) (type 0)))
132 (import "" "1" (func (;1;) (type 0)))
133 (import "" "2" (func (;2;) (type 1)))
134 (import "" "3" (func (;3;) (type 0)))
135 (import "" "4" (func (;4;) (type 0)))
136 (import "" "$imports" (table (;0;) 5 5 funcref))
137 (elem (;0;) (i32.const 0) func 0 1 2 3 4)
138 (@producers
139 (processed-by "wit-component" "$CARGO_PKG_VERSION")
140 )
141 )
142 (core instance (;0;) (instantiate 2))
143 (alias export 0 "f1" (func (;0;)))
144 (core func (;0;) (canon lower (func 0)))
145 (alias export 0 "f2" (func (;1;)))
146 (core func (;1;) (canon lower (func 1)))
147 (alias core export 0 "0" (core func (;2;)))
148 (alias core export 0 "1" (core func (;3;)))
149 (core instance (;1;)
150 (export "f1" (func 0))
151 (export "f2" (func 1))
152 (export "g1" (func 2))
153 (export "g2" (func 3))
154 )
155 (alias core export 0 "2" (core func (;4;)))
156 (core instance (;2;)
157 (export "adapter-f1" (func 4))
158 )
159 (alias export 2 "foo" (func (;2;)))
160 (core func (;5;) (canon lower (func 2)))
161 (core instance (;3;)
162 (export "foo" (func 5))
163 )
164 (core instance (;4;) (instantiate 0
165 (with "foo:shared-dependency/doc" (instance 1))
166 (with "old" (instance 2))
167 (with "main-dep" (instance 3))
168 )
169 )
170 (alias core export 4 "memory" (core memory (;0;)))
171 (alias export 0 "f1" (func (;3;)))
172 (core func (;6;) (canon lower (func 3)))
173 (alias export 0 "f3" (func (;4;)))
174 (core func (;7;) (canon lower (func 4)))
175 (alias core export 0 "3" (core func (;8;)))
176 (alias core export 0 "4" (core func (;9;)))
177 (core instance (;5;)
178 (export "f1" (func 6))
179 (export "f3" (func 7))
180 (export "g1" (func 8))
181 (export "g3" (func 9))
182 )
183 (alias export 3 "foo" (func (;5;)))
184 (core func (;10;) (canon lower (func 5)))
185 (core instance (;6;)
186 (export "foo" (func 10))
187 )
188 (core instance (;7;) (instantiate 1
189 (with "foo:shared-dependency/doc" (instance 5))
190 (with "adapter-dep" (instance 6))
191 )
192 )
193 (alias core export 0 "$imports" (core table (;0;)))
194 (alias export 0 "g1" (func (;6;)))
195 (alias core export 4 "cabi_realloc" (core func (;11;)))
196 (core func (;12;) (canon lower (func 6) (memory 0) (realloc 11) string-encoding=utf8))
197 (alias export 0 "g2" (func (;7;)))
198 (core func (;13;) (canon lower (func 7) (memory 0) (realloc 11) string-encoding=utf8))
199 (alias core export 7 "adapter-f1" (core func (;14;)))
200 (alias export 0 "g1" (func (;8;)))
201 (alias core export 7 "cabi_import_realloc" (core func (;15;)))
202 (core func (;16;) (canon lower (func 8) (memory 0) (realloc 15) string-encoding=utf8))
203 (alias export 0 "g3" (func (;9;)))
204 (core func (;17;) (canon lower (func 9) (memory 0) (realloc 15) string-encoding=utf8))
205 (core instance (;8;)
206 (export "$imports" (table 0))
207 (export "0" (func 12))
208 (export "1" (func 13))
209 (export "2" (func 14))
210 (export "3" (func 16))
211 (export "4" (func 17))
212 )
213 (core instance (;9;) (instantiate 3
214 (with "" (instance 8))
215 )
216 )
217 (@producers
218 (processed-by "wit-component" "$CARGO_PKG_VERSION")
219 )
220 )