[Wasm] Wrap a recursion group by a "rec" block in wat

This commit is contained in:
Zalim Bashorov
2023-07-19 17:06:23 +02:00
committed by Space Team
parent 8a9531ce3c
commit 151f5b90c7
@@ -228,14 +228,16 @@ class WasmIrToText : SExpressionBuilder() {
with(module) {
newLineList("module") {
functionTypes.forEach { appendFunctionTypeDeclaration(it) }
recGroupTypes.forEach {
when (it) {
is WasmStructDeclaration ->
appendStructTypeDeclaration(it)
is WasmArrayDeclaration ->
appendArrayTypeDeclaration(it)
is WasmFunctionType ->
appendFunctionTypeDeclaration(it)
newLineList("rec") {
recGroupTypes.forEach {
when (it) {
is WasmStructDeclaration ->
appendStructTypeDeclaration(it)
is WasmArrayDeclaration ->
appendArrayTypeDeclaration(it)
is WasmFunctionType ->
appendFunctionTypeDeclaration(it)
}
}
}
importsInOrder.forEach {