diff options
97 files changed, 748 insertions, 702 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index a75c15534..643810be4 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -67,11 +67,13 @@ static std::ostream& printLocal(Index index, Function* func, std::ostream& o) { return printName(name, o); } -static void -printHeapTypeName(std::ostream& os, HeapType type, bool first = true); +static void printHeapTypeName(std::ostream& os, + HeapType type, + Module* wasm = nullptr, + bool first = true); // Prints the name of a type. This output is guaranteed to not contain spaces. -static void printTypeName(std::ostream& os, Type type) { +static void printTypeName(std::ostream& os, Type type, Module* wasm = nullptr) { if (type.isBasic()) { os << type; return; @@ -82,7 +84,7 @@ static void printTypeName(std::ostream& os, Type type) { if (rtt.hasDepth()) { os << rtt.depth << '_'; } - printHeapTypeName(os, rtt.heapType); + printHeapTypeName(os, rtt.heapType, wasm); return; } if (type.isTuple()) { @@ -90,7 +92,7 @@ static void printTypeName(std::ostream& os, Type type) { for (auto t : type) { os << sep; sep = "_"; - printTypeName(os, t); + printTypeName(os, t, wasm); } return; } @@ -100,14 +102,15 @@ static void printTypeName(std::ostream& os, Type type) { os << "?"; } os << "|"; - printHeapTypeName(os, type.getHeapType(), false); + printHeapTypeName(os, type.getHeapType(), wasm, false); os << "|"; return; } WASM_UNREACHABLE("unsupported print type"); } -static void printFieldName(std::ostream& os, const Field& field) { +static void +printFieldName(std::ostream& os, const Field& field, Module* wasm = nullptr) { if (field.mutable_) { os << "mut:"; } @@ -120,29 +123,39 @@ static void printFieldName(std::ostream& os, const Field& field) { WASM_UNREACHABLE("invalid packed type"); } } else { - printTypeName(os, field.type); + printTypeName(os, field.type, wasm); } } // Prints the name of a heap type. As with printTypeName, this output is // guaranteed to not contain spaces. -static void printHeapTypeName(std::ostream& os, HeapType type, bool first) { +static void +printHeapTypeName(std::ostream& os, HeapType type, Module* wasm, bool first) { if (type.isBasic()) { os << type; return; } + // If there is a name for this type in this module, use it. + // FIXME: in theory there could be two types, one with a name, and one + // without, and the one without gets an automatic name that matches the + // other's. To check for that, if (first) we could assert at the very end of + // this function that the automatic name is not present in the given names. + if (wasm && wasm->typeNames.count(type)) { + os << '$' << wasm->typeNames[type].name; + return; + } if (first) { os << '$'; } if (type.isSignature()) { auto sig = type.getSignature(); - printTypeName(os, sig.params); + printTypeName(os, sig.params, wasm); if (first) { os << "_=>_"; } else { os << "_->_"; } - printTypeName(os, sig.results); + printTypeName(os, sig.results, wasm); } else if (type.isStruct()) { auto struct_ = type.getStruct(); os << "{"; @@ -150,12 +163,12 @@ static void printHeapTypeName(std::ostream& os, HeapType type, bool first) { for (auto& field : struct_.fields) { os << sep; sep = "_"; - printFieldName(os, field); + printFieldName(os, field, wasm); } os << "}"; } else if (type.isArray()) { os << "["; - printFieldName(os, type.getArray().element); + printFieldName(os, type.getArray().element, wasm); os << "]"; } else { os << type; @@ -169,13 +182,16 @@ struct SExprType { SExprType(Type type) : type(type){}; }; -static std::ostream& operator<<(std::ostream& o, const SExprType& sType) { +static std::ostream& printSExprType(std::ostream& o, + const SExprType& sType, + Module* wasm = nullptr) { Type type = sType.type; if (type.isTuple()) { o << '('; auto sep = ""; for (const auto& t : type) { - o << sep << SExprType(t); + o << sep; + printSExprType(o, t, wasm); sep = " "; } o << ')'; @@ -185,17 +201,17 @@ static std::ostream& operator<<(std::ostream& o, const SExprType& sType) { if (rtt.hasDepth()) { o << rtt.depth << ' '; } - printHeapTypeName(o, rtt.heapType); + printHeapTypeName(o, rtt.heapType, wasm); o << ')'; } else if (type.isRef() && !type.isBasic()) { o << "(ref "; if (type.isNullable()) { o << "null "; } - printHeapTypeName(o, type.getHeapType()); + printHeapTypeName(o, type.getHeapType(), wasm); o << ')'; } else { - printTypeName(o, sType.type); + printTypeName(o, sType.type, wasm); } return o; } @@ -207,7 +223,9 @@ struct ResultTypeName { ResultTypeName(Type type) : type(type) {} }; -std::ostream& operator<<(std::ostream& os, ResultTypeName typeName) { +std::ostream& printResultTypeName(std::ostream& os, + ResultTypeName typeName, + Module* wasm = nullptr) { auto type = typeName.type; os << "(result "; if (type.isTuple()) { @@ -217,10 +235,10 @@ std::ostream& operator<<(std::ostream& os, ResultTypeName typeName) { for (auto t : type) { os << sep; sep = " "; - os << SExprType(t); + printSExprType(os, t, wasm); } } else { - os << SExprType(type); + printSExprType(os, type, wasm); } os << ')'; return os; @@ -238,14 +256,13 @@ static Type forceConcrete(Type type) { // the children. struct PrintExpressionContents : public OverriddenVisitor<PrintExpressionContents> { + Module* wasm = nullptr; Function* currFunction = nullptr; std::ostream& o; FeatureSet features; - PrintExpressionContents(Function* currFunction, - FeatureSet features, - std::ostream& o) - : currFunction(currFunction), o(o), features(features) {} + PrintExpressionContents(Module* wasm, Function* currFunction, std::ostream& o) + : wasm(wasm), currFunction(currFunction), o(o), features(wasm->features) {} PrintExpressionContents(Function* currFunction, std::ostream& o) : currFunction(currFunction), o(o), features(FeatureSet::All) {} @@ -257,13 +274,15 @@ struct PrintExpressionContents printName(curr->name, o); } if (curr->type.isConcrete()) { - o << ' ' << ResultTypeName(curr->type); + o << ' '; + printResultTypeName(o, curr->type, wasm); } } void visitIf(If* curr) { printMedium(o, "if"); if (curr->type.isConcrete()) { - o << ' ' << ResultTypeName(curr->type); + o << ' '; + printResultTypeName(o, curr->type, wasm); } } void visitLoop(Loop* curr) { @@ -273,7 +292,8 @@ struct PrintExpressionContents printName(curr->name, o); } if (curr->type.isConcrete()) { - o << ' ' << ResultTypeName(curr->type); + o << ' '; + printResultTypeName(o, curr->type, wasm); } } void visitBreak(Break* curr) { @@ -315,7 +335,7 @@ struct PrintExpressionContents o << '('; printMinor(o, "type "); - printHeapTypeName(o, curr->sig); + printHeapTypeName(o, curr->sig, wasm); o << ')'; } void visitLocalGet(LocalGet* curr) { @@ -1728,7 +1748,8 @@ struct PrintExpressionContents void visitSelect(Select* curr) { prepareColor(o) << "select"; if (curr->type.isRef()) { - o << ' ' << ResultTypeName(curr->type); + o << ' '; + printResultTypeName(o, curr->type, wasm); } } void visitDrop(Drop* curr) { printMedium(o, "drop"); } @@ -1737,7 +1758,7 @@ struct PrintExpressionContents void visitMemoryGrow(MemoryGrow* curr) { printMedium(o, "memory.grow"); } void visitRefNull(RefNull* curr) { printMedium(o, "ref.null "); - printHeapTypeName(o, curr->type.getHeapType()); + printHeapTypeName(o, curr->type.getHeapType(), wasm); } void visitRefIs(RefIs* curr) { switch (curr->op) { @@ -1808,11 +1829,11 @@ struct PrintExpressionContents } void visitRefTest(RefTest* curr) { printMedium(o, "ref.test "); - printHeapTypeName(o, curr->getCastType().getHeapType()); + printHeapTypeName(o, curr->getCastType().getHeapType(), wasm); } void visitRefCast(RefCast* curr) { printMedium(o, "ref.cast "); - printHeapTypeName(o, curr->getCastType().getHeapType()); + printHeapTypeName(o, curr->getCastType().getHeapType(), wasm); } void visitBrOn(BrOn* curr) { switch (curr->op) { @@ -1838,11 +1859,11 @@ struct PrintExpressionContents } void visitRttCanon(RttCanon* curr) { printMedium(o, "rtt.canon "); - printHeapTypeName(o, curr->type.getRtt().heapType); + printHeapTypeName(o, curr->type.getRtt().heapType, wasm); } void visitRttSub(RttSub* curr) { printMedium(o, "rtt.sub "); - printHeapTypeName(o, curr->type.getRtt().heapType); + printHeapTypeName(o, curr->type.getRtt().heapType, wasm); } void visitStructNew(StructNew* curr) { printMedium(o, "struct.new_"); @@ -1850,7 +1871,7 @@ struct PrintExpressionContents o << "default_"; } o << "with_rtt "; - printHeapTypeName(o, curr->rtt->type.getHeapType()); + printHeapTypeName(o, curr->rtt->type.getHeapType(), wasm); } void printUnreachableReplacement() { // If we cannot print a valid unreachable instruction (say, a struct.get, @@ -1875,7 +1896,7 @@ struct PrintExpressionContents } else { printMedium(o, "struct.get "); } - printHeapTypeName(o, curr->ref->type.getHeapType()); + printHeapTypeName(o, curr->ref->type.getHeapType(), wasm); o << ' '; o << curr->index; } @@ -1885,7 +1906,7 @@ struct PrintExpressionContents return; } printMedium(o, "struct.set "); - printHeapTypeName(o, curr->ref->type.getHeapType()); + printHeapTypeName(o, curr->ref->type.getHeapType(), wasm); o << ' '; o << curr->index; } @@ -1895,7 +1916,7 @@ struct PrintExpressionContents o << "default_"; } o << "with_rtt "; - printHeapTypeName(o, curr->rtt->type.getHeapType()); + printHeapTypeName(o, curr->rtt->type.getHeapType(), wasm); } void visitArrayGet(ArrayGet* curr) { const auto& element = curr->ref->type.getHeapType().getArray().element; @@ -1908,15 +1929,15 @@ struct PrintExpressionContents } else { printMedium(o, "array.get "); } - printHeapTypeName(o, curr->ref->type.getHeapType()); + printHeapTypeName(o, curr->ref->type.getHeapType(), wasm); } void visitArraySet(ArraySet* curr) { printMedium(o, "array.set "); - printHeapTypeName(o, curr->ref->type.getHeapType()); + printHeapTypeName(o, curr->ref->type.getHeapType(), wasm); } void visitArrayLen(ArrayLen* curr) { printMedium(o, "array.len "); - printHeapTypeName(o, curr->ref->type.getHeapType()); + printHeapTypeName(o, curr->ref->type.getHeapType(), wasm); } void visitRefAs(RefAs* curr) { switch (curr->op) { @@ -2019,8 +2040,7 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { void printExpressionContents(Expression* curr) { if (currModule) { - PrintExpressionContents(currFunction, currModule->features, o) - .visit(curr); + PrintExpressionContents(currModule, currFunction, o).visit(curr); } else { PrintExpressionContents(currFunction, o).visit(curr); } @@ -2761,7 +2781,8 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { o << "(param "; auto sep = ""; for (auto type : curr.params) { - o << sep << SExprType(type); + o << sep; + printSExprType(o, type, currModule); sep = " "; } o << ')'; @@ -2771,7 +2792,8 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { o << "(result "; auto sep = ""; for (auto type : curr.results) { - o << sep << SExprType(type); + o << sep; + printSExprType(o, type, currModule); sep = " "; } o << ')'; @@ -2791,7 +2813,7 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { WASM_UNREACHABLE("invalid packed type"); } } else { - o << SExprType(field.type); + printSExprType(o, field.type, currModule); } if (field.mutable_) { o << ')'; @@ -2864,9 +2886,10 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { } void emitGlobalType(Global* curr) { if (curr->mutable_) { - o << "(mut " << SExprType(curr->type) << ')'; + o << "(mut "; + printSExprType(o, curr->type, currModule) << ')'; } else { - o << SExprType(curr->type); + printSExprType(o, curr->type, currModule); } } void visitImportedGlobal(Global* curr) { @@ -2926,21 +2949,22 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { o << '('; printMinor(o, "param "); printLocal(i, currFunction, o); - o << ' ' << SExprType(param) << ')'; + o << ' '; + printSExprType(o, param, currModule) << ')'; ++i; } } if (curr->sig.results != Type::none) { o << maybeSpace; - o << ResultTypeName(curr->sig.results); + printResultTypeName(o, curr->sig.results, currModule); } incIndent(); for (size_t i = curr->getVarIndexBase(); i < curr->getNumLocals(); i++) { doIndent(o, indent); o << '('; printMinor(o, "local "); - printLocal(i, currFunction, o) - << ' ' << SExprType(curr->getLocalType(i)) << ')'; + printLocal(i, currFunction, o) << ' '; + printSExprType(o, curr->getLocalType(i), currModule) << ')'; o << maybeNewLine; } // Print the body. @@ -3175,7 +3199,7 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { doIndent(o, indent); o << '('; printMedium(o, "type") << ' '; - printHeapTypeName(o, type); + printHeapTypeName(o, type, curr); o << ' '; handleHeapType(type); o << ")" << maybeNewLine; diff --git a/src/wasm.h b/src/wasm.h index 199257925..4060bac4d 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1872,6 +1872,16 @@ public: // Module name, if specified. Serves a documentary role only. Name name; + // Optional type name information, used in printing only. Note that Types are + // globally interned, but type names are specific to a module. + struct TypeNames { + // The name of the type. + Name name; + // For a Struct, names of fields. + std::unordered_map<Index, Name> fieldNames; + }; + std::unordered_map<HeapType, TypeNames> typeNames; + MixedArena allocator; private: diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 4e9ebcc45..df01a18d8 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -843,6 +843,18 @@ void SExpressionWasmBuilder::preParseHeapTypes(Element& module) { }); types = builder.build(); + + for (auto& pair : typeIndices) { + auto name = pair.first; + auto type = types[pair.second]; + // A type may appear in the type section more than once, but we canonicalize + // types internally, so there will be a single name chosen for that type. Do + // so determistically. + if (wasm.typeNames.count(type) && wasm.typeNames[type].name.str < name) { + continue; + } + wasm.typeNames[type].name = name; + } } void SExpressionWasmBuilder::preParseFunctionType(Element& s) { diff --git a/test/atomics.wast.from-wast b/test/atomics.wast.from-wast index 5140f3901..f5f891af5 100644 --- a/test/atomics.wast.from-wast +++ b/test/atomics.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 (shared 23 256)) (func $atomic-loadstore (local $0 i32) diff --git a/test/atomics64.wast.from-wast b/test/atomics64.wast.from-wast index ee4eb1bdf..669920d50 100644 --- a/test/atomics64.wast.from-wast +++ b/test/atomics64.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 (shared i64 23 256)) (func $atomic-loadstore (local $0 i64) diff --git a/test/binaryen.js/optimize-levels.js.txt b/test/binaryen.js/optimize-levels.js.txt index d318ad588..b5005dd0e 100644 --- a/test/binaryen.js/optimize-levels.js.txt +++ b/test/binaryen.js/optimize-levels.js.txt @@ -16,7 +16,7 @@ === unoptimized === (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (memory $0 0) (export "test" (func $test)) (func $test (param $0 i32) (result i32) @@ -34,7 +34,7 @@ optimizeLevel=2 shrinkLevel=1 (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (; has Stack IR ;) (param $0 i32) (result i32) (select @@ -49,7 +49,7 @@ shrinkLevel=1 optimizeLevel=0 shrinkLevel=0 (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (param $0 i32) (result i32) (select @@ -64,7 +64,7 @@ shrinkLevel=0 optimizeLevel=2 shrinkLevel=1 (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (; has Stack IR ;) (param $0 i32) (result i32) (select diff --git a/test/binaryen.js/stackir.js.txt b/test/binaryen.js/stackir.js.txt index 60dabce98..976dd815a 100644 --- a/test/binaryen.js/stackir.js.txt +++ b/test/binaryen.js/stackir.js.txt @@ -18,7 +18,7 @@ === default === (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (memory $0 0) (export "test" (func $test)) (func $test (param $0 i32) (result i32) @@ -35,7 +35,7 @@ === optimize === (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i (func (param i32) (result i32))) (memory $0 0) (export "test" (func $test)) (func $test (param $0 i32) (result i32) diff --git a/test/ctor-eval/bad-indirect-call.wast.out b/test/ctor-eval/bad-indirect-call.wast.out index 6629e6bbb..8ab14a36d 100644 --- a/test/ctor-eval/bad-indirect-call.wast.out +++ b/test/ctor-eval/bad-indirect-call.wast.out @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (memory $0 256 256) (data (i32.const 10) "waka waka waka waka waka") (table $0 1 1 funcref) (elem (i32.const 0) $call-indirect) (export "test1" (func $test1)) (func $test1 - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $v) (i32.const 1) ) (i32.store8 diff --git a/test/ctor-eval/bad-indirect-call2.wast.out b/test/ctor-eval/bad-indirect-call2.wast.out index 9a9186a78..3ae51dfa8 100644 --- a/test/ctor-eval/bad-indirect-call2.wast.out +++ b/test/ctor-eval/bad-indirect-call2.wast.out @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (import "env" "_abort" (func $_abort)) (memory $0 256 256) (data (i32.const 10) "waka waka waka waka waka") @@ -7,7 +7,7 @@ (elem (i32.const 0) $_abort $call-indirect) (export "test1" (func $test1)) (func $test1 - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $v) (i32.const 0) ) (i32.store8 diff --git a/test/ctor-eval/basics-flatten.wast.out b/test/ctor-eval/basics-flatten.wast.out index 9deb3e1d6..f13d5f7a0 100644 --- a/test/ctor-eval/basics-flatten.wast.out +++ b/test/ctor-eval/basics-flatten.wast.out @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (memory $0 256 256) (data (i32.const 10) "nas\00\00\00aka\00yzkx waka wakm\00\00\00\00\00\00C") (func $call-indirect diff --git a/test/ctor-eval/basics.wast.out b/test/ctor-eval/basics.wast.out index cb4c8deda..8d82afc80 100644 --- a/test/ctor-eval/basics.wast.out +++ b/test/ctor-eval/basics.wast.out @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (memory $0 256 256) (data (i32.const 10) "nas\00\00\00aka yzkx waka wakm\00\00\00\00\00\00C") (func $call-indirect diff --git a/test/ctor-eval/indirect-call3.wast.out b/test/ctor-eval/indirect-call3.wast.out index 048ca9824..10914bca7 100644 --- a/test/ctor-eval/indirect-call3.wast.out +++ b/test/ctor-eval/indirect-call3.wast.out @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_abort" (func $_abort)) (memory $0 256 256) diff --git a/test/duplicate_types.wast.from-wast b/test/duplicate_types.wast.from-wast index 44d25daf4..ce6637bf6 100644 --- a/test/duplicate_types.wast.from-wast +++ b/test/duplicate_types.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (func $f0 (param $0 i32) (nop) diff --git a/test/export-import.wast.from-wast b/test/export-import.wast.from-wast index c7abd619b..f8ebdfd24 100644 --- a/test/export-import.wast.from-wast +++ b/test/export-import.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $v (func)) (import "env" "test2" (global $test2 i32)) (import "env" "test1" (func $test1)) (export "test1" (func $test1)) diff --git a/test/grow_memory.wast.from-wast b/test/grow_memory.wast.from-wast index 2ebbfc9d3..86ae48670 100644 --- a/test/grow_memory.wast.from-wast +++ b/test/grow_memory.wast.from-wast @@ -1,6 +1,6 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $1 (func (result i32))) + (type $0 (func (param i32) (result i32))) (memory $0 1) (export "memory" (memory $0)) (export "grow" (func $0)) diff --git a/test/heap-types.wast.from-wast b/test/heap-types.wast.from-wast index d45e5c37c..ca45eb0af 100644 --- a/test/heap-types.wast.from-wast +++ b/test/heap-types.wast.from-wast @@ -1,105 +1,105 @@ (module - (type ${i32_f32_f64} (struct (field i32) (field f32) (field f64))) - (type ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} (struct (field i8) (field (mut i16)) (field (ref null ${i32_f32_f64})) (field (mut (ref null ${i32_f32_f64}))))) - (type $[ref?|[mut:f64]|] (array (ref null $[mut:f64]))) - (type $[mut:f64] (array (mut f64))) + (type $struct.A (struct (field i32) (field f32) (field f64))) + (type $struct.B (struct (field i8) (field (mut i16)) (field (ref null $struct.A)) (field (mut (ref null $struct.A))))) + (type $matrix (array (ref null $vector))) + (type $vector (array (mut f64))) (type $anyref_=>_none (func (param anyref))) - (type ${} (struct )) - (type ${mut:f32} (struct (field (mut f32)))) + (type $parent (struct )) + (type $struct.C (struct (field (mut f32)))) (type $none_=>_none (func)) - (type $rtt_1_${}_=>_none (func (param (rtt 1 ${})))) - (type $rtt_${}_=>_none (func (param (rtt ${})))) - (type $ref?|{i32_f32_f64}|_=>_ref?|{i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}| (func (param (ref null ${i32_f32_f64})) (result (ref null ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|})))) - (type $ref?|[mut:f64]|_=>_ref?|[ref?|[mut:f64]|]| (func (param (ref null $[mut:f64])) (result (ref null $[ref?|[mut:f64]|])))) - (type ${i32} (struct (field i32))) - (type ${i32_i64} (struct (field i32) (field i64))) - (type $[mut:i32] (array (mut i32))) - (type $[mut:i8] (array (mut i8))) - (global $rttparent (rtt 0 ${}) (rtt.canon ${})) - (global $rttchild (rtt 1 ${i32}) (rtt.sub ${i32} + (type $rtt_1_$parent_=>_none (func (param (rtt 1 $parent)))) + (type $rtt_$parent_=>_none (func (param (rtt $parent)))) + (type $ref?|$struct.A|_=>_ref?|$struct.B| (func (param (ref null $struct.A)) (result (ref null $struct.B)))) + (type $ref?|$vector|_=>_ref?|$matrix| (func (param (ref null $vector)) (result (ref null $matrix)))) + (type $child (struct (field i32))) + (type $grandchild (struct (field i32) (field i64))) + (type $words (array (mut i32))) + (type $bytes (array (mut i8))) + (global $rttparent (rtt 0 $parent) (rtt.canon $parent)) + (global $rttchild (rtt 1 $child) (rtt.sub $child (global.get $rttparent) )) - (global $rttgrandchild (rtt 2 ${i32_i64}) (rtt.sub ${i32_i64} + (global $rttgrandchild (rtt 2 $grandchild) (rtt.sub $grandchild (global.get $rttchild) )) - (func $structs (param $x (ref null ${i32_f32_f64})) (result (ref null ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|})) - (local $tA (ref null ${i32_f32_f64})) - (local $tB (ref null ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|})) - (local $tc (ref null ${mut:f32})) - (local $tv (ref null $[mut:f64])) - (local $tm (ref null $[ref?|[mut:f64]|])) + (func $structs (param $x (ref null $struct.A)) (result (ref null $struct.B)) + (local $tA (ref null $struct.A)) + (local $tB (ref null $struct.B)) + (local $tc (ref null $struct.C)) + (local $tv (ref null $vector)) + (local $tm (ref null $matrix)) (drop (local.get $x) ) (drop - (struct.get ${i32_f32_f64} 0 + (struct.get $struct.A 0 (local.get $x) ) ) (drop - (struct.get ${i32_f32_f64} 1 + (struct.get $struct.A 1 (local.get $x) ) ) (drop - (struct.get ${i32_f32_f64} 2 + (struct.get $struct.A 2 (local.get $x) ) ) (drop - (struct.get ${i32_f32_f64} 2 + (struct.get $struct.A 2 (local.get $x) ) ) (drop - (struct.get_u ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} 0 + (struct.get_u $struct.B 0 (local.get $tB) ) ) (drop - (struct.get_s ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} 0 + (struct.get_s $struct.B 0 (local.get $tB) ) ) (drop - (ref.null ${i32_f32_f64}) + (ref.null $struct.A) ) (drop - (block $block (result (ref null ${i32_f32_f64})) + (block $block (result (ref null $struct.A)) (local.get $x) ) ) (drop - (if (result (ref null ${i32_f32_f64})) + (if (result (ref null $struct.A)) (i32.const 1) (local.get $x) (local.get $x) ) ) (drop - (loop $loop-in (result (ref null ${i32_f32_f64})) + (loop $loop-in (result (ref null $struct.A)) (local.get $x) ) ) (drop - (select (result (ref null ${i32_f32_f64})) + (select (result (ref null $struct.A)) (local.get $x) (local.get $x) (i32.const 1) ) ) - (struct.set ${mut:f32} 0 - (ref.null ${mut:f32}) + (struct.set $struct.C 0 + (ref.null $struct.C) (f32.const 100) ) (drop - (struct.new_default_with_rtt ${i32_f32_f64} - (rtt.canon ${i32_f32_f64}) + (struct.new_default_with_rtt $struct.A + (rtt.canon $struct.A) ) ) (drop - (struct.new_with_rtt ${i32_f32_f64} - (rtt.canon ${i32_f32_f64}) + (struct.new_with_rtt $struct.A + (rtt.canon $struct.A) (i32.const 1) (f32.const 2.3450000286102295) (f64.const 3.14159) @@ -107,91 +107,91 @@ ) (unreachable) ) - (func $arrays (param $x (ref null $[mut:f64])) (result (ref null $[ref?|[mut:f64]|])) - (local $tv (ref null $[mut:f64])) - (local $tm (ref null $[ref?|[mut:f64]|])) - (local $tb (ref null $[mut:i8])) - (local $tw (ref null $[mut:i32])) - (drop - (array.new_with_rtt $[mut:f64] - (rtt.canon $[mut:f64]) + (func $arrays (param $x (ref null $vector)) (result (ref null $matrix)) + (local $tv (ref null $vector)) + (local $tm (ref null $matrix)) + (local $tb (ref null $bytes)) + (local $tw (ref null $words)) + (drop + (array.new_with_rtt $vector + (rtt.canon $vector) (i32.const 3) (f64.const 3.14159) ) ) (drop - (array.new_default_with_rtt $[ref?|[mut:f64]|] - (rtt.canon $[ref?|[mut:f64]|]) + (array.new_default_with_rtt $matrix + (rtt.canon $matrix) (i32.const 10) ) ) (drop - (array.get $[mut:f64] + (array.get $vector (local.get $x) (i32.const 2) ) ) - (array.set $[mut:f64] + (array.set $vector (local.get $x) (i32.const 2) (f64.const 2.18281828) ) (drop - (array.len $[mut:f64] + (array.len $vector (local.get $x) ) ) (drop - (array.get $[mut:i32] + (array.get $words (local.get $tw) (i32.const 1) ) ) (drop - (array.get_u $[mut:i8] + (array.get_u $bytes (local.get $tb) (i32.const 2) ) ) (drop - (array.get_s $[mut:i8] + (array.get_s $bytes (local.get $tb) (i32.const 3) ) ) (unreachable) ) - (func $rtt-param-with-depth (param $rtt (rtt 1 ${})) + (func $rtt-param-with-depth (param $rtt (rtt 1 $parent)) (nop) ) - (func $rtt-param-without-depth (param $rtt (rtt ${})) + (func $rtt-param-without-depth (param $rtt (rtt $parent)) (nop) ) (func $rtt-operations - (local $temp.A (ref null ${i32_f32_f64})) + (local $temp.A (ref null $struct.A)) (drop - (ref.test ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} - (ref.null ${i32_f32_f64}) - (rtt.canon ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}) + (ref.test $struct.B + (ref.null $struct.A) + (rtt.canon $struct.B) ) ) (drop - (ref.cast ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|} - (ref.null ${i32_f32_f64}) - (rtt.canon ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}) + (ref.cast $struct.B + (ref.null $struct.A) + (rtt.canon $struct.B) ) ) (drop - (block $out (result (ref null ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|})) + (block $out (result (ref null $struct.B)) (local.set $temp.A (br_on_cast $out - (ref.null ${i32_f32_f64}) - (rtt.canon ${i8_mut:i16_ref?|{i32_f32_f64}|_mut:ref?|{i32_f32_f64}|}) + (ref.null $struct.A) + (rtt.canon $struct.B) ) ) (block (drop - (ref.null ${i32_f32_f64}) + (ref.null $struct.A) ) (unreachable) ) diff --git a/test/kitchen_sink.wast.from-wast b/test/kitchen_sink.wast.from-wast index ad2f93d02..bdf6279b7 100644 --- a/test/kitchen_sink.wast.from-wast +++ b/test/kitchen_sink.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 4096 4096) (data (i32.const 1026) "\14\00") (func $kitchensink (result i32) diff --git a/test/lit/forward-declared-types.wast b/test/lit/forward-declared-types.wast index 002e7ceb3..a335f0d09 100644 --- a/test/lit/forward-declared-types.wast +++ b/test/lit/forward-declared-types.wast @@ -2,10 +2,10 @@ ;; RUN: wasm-opt %s -all -S -o - | filecheck %s -;; CHECK: (type $none_=>_none (func)) -;; CHECK: (type $none_=>_ref?|{ref?|[rtt_2_$none_=>_none]|_ref?|none_->_none|}| (func (result (ref null ${ref?|[rtt_2_$none_=>_none]|_ref?|none_->_none|})))) -;; CHECK: (type ${ref?|[rtt_2_$none_=>_none]|_ref?|none_->_none|} (struct (field (ref null $[rtt_2_$none_=>_none])) (field (ref null $none_=>_none)))) -;; CHECK: (type $[rtt_2_$none_=>_none] (array (rtt 2 $none_=>_none))) +;; CHECK: (type $func (func)) +;; CHECK: (type $none_=>_ref?|$struct| (func (result (ref null $struct)))) +;; CHECK: (type $struct (struct (field (ref null $array)) (field (ref null $func)))) +;; CHECK: (type $array (array (rtt 2 $func))) (module (type $struct (struct diff --git a/test/lit/passes/optimize-instructions-typed-function-references.wast b/test/lit/passes/optimize-instructions-typed-function-references.wast index 6a80d3d30..812815c2d 100644 --- a/test/lit/passes/optimize-instructions-typed-function-references.wast +++ b/test/lit/passes/optimize-instructions-typed-function-references.wast @@ -7,7 +7,7 @@ ;; this function has a reference parameter. we analyze parameters, and should ;; not be confused by a type that has no bit size, in particular. this test ;; just verifies that we do not crash on that. - ;; CHECK: (func $call_from-param (param $f (ref null $i32_=>_i32)) (result i32) + ;; CHECK: (func $call_from-param (param $f (ref null $i32-i32)) (result i32) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) (func $call_from-param (param $f (ref null $i32-i32)) (result i32) diff --git a/test/lld/duplicate_imports.wat.out b/test/lld/duplicate_imports.wat.out index 09d5bb1fc..f6e1b1223 100644 --- a/test/lld/duplicate_imports.wat.out +++ b/test/lld/duplicate_imports.wat.out @@ -1,9 +1,9 @@ (module (type $i32_f32_f64_=>_f32 (func (param i32 f32 f64) (result f32))) (type $i32_f64_f64_=>_f32 (func (param i32 f64 f64) (result f32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $2 (func)) + (type $1 (func (result i32))) + (type $0 (func (param i32) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $f32_f64_=>_f32 (func (param f32 f64) (result f32))) diff --git a/test/lld/em_asm_main_thread.wat.out b/test/lld/em_asm_main_thread.wat.out index 9609cef56..8fc99e081 100644 --- a/test/lld/em_asm_main_thread.wat.out +++ b/test/lld/em_asm_main_thread.wat.out @@ -1,11 +1,11 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $2 (func (result i32))) + (type $1 (func)) + (type $4 (func (param i32 i32))) + (type $3 (func (param i32 i32 i32))) + (type $5 (func (param i32) (result i32))) + (type $6 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32 i32) (result i32))) (import "env" "emscripten_asm_const_int_sync_on_main_thread" (func $emscripten_asm_const_int_sync_on_main_thread (param i32 i32 i32) (result i32))) (memory $0 2) (data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") diff --git a/test/lld/em_asm_table.wat.out b/test/lld/em_asm_table.wat.out index 7850f9fe9..99baf943b 100644 --- a/test/lld/em_asm_table.wat.out +++ b/test/lld/em_asm_table.wat.out @@ -1,6 +1,6 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $0 (func (param i32 i32))) + (type $1 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "memory" (memory $2 8192)) @@ -14,14 +14,14 @@ (export "dynCall_vii" (func $dynCall_vii)) (export "dynCall_iiii" (func $dynCall_iiii)) (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32) - (call_indirect (type $i32_i32_=>_none) + (call_indirect (type $0) (local.get $0) (local.get $1) (local.get $fptr) ) ) (func $dynCall_iiii (param $fptr i32) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $1) (local.get $0) (local.get $1) (local.get $2) diff --git a/test/lld/hello_world.passive.wat.out b/test/lld/hello_world.passive.wat.out index df2e87368..ea7c0e183 100644 --- a/test/lld/hello_world.passive.wat.out +++ b/test/lld/hello_world.passive.wat.out @@ -1,8 +1,8 @@ (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $0 (func (param i32) (result i32))) + (type $3 (func (param i32 i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) (memory $0 2) (data passive "Hello, world\00") diff --git a/test/lld/main_module.wat.out b/test/lld/main_module.wat.out index 60013d46b..9cc6cd268 100644 --- a/test/lld/main_module.wat.out +++ b/test/lld/main_module.wat.out @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) + (type $0 (func (param i32) (result i32))) (import "env" "memory" (memory $0 0)) (data (global.get $gimport$2) "Hello, world\00\00\00\00\00\00\00\00\00\00\00\00") (import "env" "__indirect_function_table" (table $timport$1 0 funcref)) diff --git a/test/lld/recursive_safe_stack.wat.out b/test/lld/recursive_safe_stack.wat.out index 5043fc6e8..7e8037ea0 100644 --- a/test/lld/recursive_safe_stack.wat.out +++ b/test/lld/recursive_safe_stack.wat.out @@ -1,8 +1,8 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func)) (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_i32 (func (result i32))) + (type $2 (func (result i32))) (import "env" "printf" (func $printf (param i32 i32) (result i32))) (import "env" "__handle_stack_overflow" (func $__handle_stack_overflow)) (memory $0 2) diff --git a/test/lld/safe_stack_standalone-wasm.wat.out b/test/lld/safe_stack_standalone-wasm.wat.out index b9ee7bdea..87d723ed5 100644 --- a/test/lld/safe_stack_standalone-wasm.wat.out +++ b/test/lld/safe_stack_standalone-wasm.wat.out @@ -1,8 +1,8 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func)) (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_i32 (func (result i32))) + (type $2 (func (result i32))) (import "env" "printf" (func $printf (param i32 i32) (result i32))) (memory $0 2) (data (i32.const 568) "%d:%d\n\00Result: %d\n\00") diff --git a/test/memory-import.wast.from-wast b/test/memory-import.wast.from-wast index 3fd964d9b..4d27bcc4e 100644 --- a/test/memory-import.wast.from-wast +++ b/test/memory-import.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (import "env" "memory" (memory $0 1 1)) (func $foo (result i32) (i32.load offset=13 diff --git a/test/memory-import64.wast.from-wast b/test/memory-import64.wast.from-wast index 60a280c0e..8f9d70886 100644 --- a/test/memory-import64.wast.from-wast +++ b/test/memory-import64.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (import "env" "memory" (memory $0 i64 1 1)) (func $foo (result i32) (i32.load offset=13 diff --git a/test/min.wast.from-wast b/test/min.wast.from-wast index 3998f43b4..f5cf0d199 100644 --- a/test/min.wast.from-wast +++ b/test/min.wast.from-wast @@ -1,8 +1,8 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $f32_=>_f32 (func (param f32) (result f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $2 (func (param i32) (result i32))) + (type $3 (func (param i32 i32 i32) (result i32))) + (type $0 (func (param f32) (result f32))) + (type $1 (func (param i32 i32) (result f32))) (memory $0 256 256) (export "floats" (func $floats)) (func $floats (param $f f32) (result f32) diff --git a/test/mutable-global.wast.from-wast b/test/mutable-global.wast.from-wast index e6f53240c..ab54153c1 100644 --- a/test/mutable-global.wast.from-wast +++ b/test/mutable-global.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "global-mut" (global $global-mut (mut i32))) (func $foo (global.set $global-mut diff --git a/test/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.txt b/test/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.txt index 023709819..0b52b5a56 100644 --- a/test/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.txt +++ b/test/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.txt @@ -1,5 +1,5 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $t0 (func (param i32) (result i32))) (memory $memory 0) (export "fib" (func $fib)) (export "looped" (func $looped)) diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt index db50f97a8..51873d73f 100644 --- a/test/passes/O3_low-memory-unused_metrics.txt +++ b/test/passes/O3_low-memory-unused_metrics.txt @@ -26,10 +26,10 @@ total Store : 160 Unary : 29 (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $2 (func (param i32 i32) (result i32))) + (type $0 (func (param i32 i32 i32) (result i32))) + (type $10 (func (param i32))) + (type $3 (func (param i32 i32 i32 i32))) (import "env" "memory" (memory $108 4096 4096)) (import "env" "table" (table $timport$109 10 funcref)) (import "env" "crc32" (func $fimport$14 (param i32 i32 i32) (result i32))) @@ -2445,7 +2445,7 @@ total ) ) ) - (call_indirect (type $i32_i32_=>_i32) + (call_indirect (type $2) (local.get $2) (local.get $1) (i32.load diff --git a/test/passes/O4_disable-bulk-memory.txt b/test/passes/O4_disable-bulk-memory.txt index b7a3dba06..bd9dbd6bf 100644 --- a/test/passes/O4_disable-bulk-memory.txt +++ b/test/passes/O4_disable-bulk-memory.txt @@ -1,18 +1,18 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (export "func_59_invoker" (func $0)) (func $0 (; has Stack IR ;) (unreachable) ) ) (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) + (type $0 (func)) + (type $11 (func (param i32))) + (type $3 (func (param i32) (result i32))) + (type $4 (func (result i32))) (type $f64_f64_f64_f64_f64_f64_f64_=>_i32 (func (param f64 f64 f64 f64 f64 f64 f64) (result i32))) - (type $none_=>_f64 (func (result f64))) - (type $i32_=>_f64 (func (param i32) (result f64))) + (type $8 (func (result f64))) + (type $10 (func (param i32) (result f64))) (import "env" "memory" (memory $1 1)) (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") diff --git a/test/passes/O_all-features.txt b/test/passes/O_all-features.txt index 761c4aeed..00b88ad32 100644 --- a/test/passes/O_all-features.txt +++ b/test/passes/O_all-features.txt @@ -1,10 +1,10 @@ (module - (type ${i32} (struct (field i32))) - (type $ref?|{i32}|_=>_none (func (param (ref null ${i32})))) + (type $struct.A (struct (field i32))) + (type $ref?|$struct.A|_=>_none (func (param (ref null $struct.A)))) (export "foo" (func $0)) - (func $0 (; has Stack IR ;) (param $0 (ref null ${i32})) + (func $0 (; has Stack IR ;) (param $0 (ref null $struct.A)) (drop - (struct.get ${i32} 0 + (struct.get $struct.A 0 (local.get $0) ) ) diff --git a/test/passes/O_all-features_ignore-implicit-traps.txt b/test/passes/O_all-features_ignore-implicit-traps.txt index 993bd10e5..785662bca 100644 --- a/test/passes/O_all-features_ignore-implicit-traps.txt +++ b/test/passes/O_all-features_ignore-implicit-traps.txt @@ -1,8 +1,8 @@ (module - (type $ref?|{i32}|_=>_none (func (param (ref null ${i32})))) - (type ${i32} (struct (field i32))) + (type $ref?|$struct.A|_=>_none (func (param (ref null $struct.A)))) + (type $struct.A (struct (field i32))) (export "foo" (func $0)) - (func $0 (; has Stack IR ;) (param $0 (ref null ${i32})) + (func $0 (; has Stack IR ;) (param $0 (ref null $struct.A)) (nop) ) ) diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt index 60d593b45..baa2a24e9 100644 --- a/test/passes/Oz_fuzz-exec_all-features.txt +++ b/test/passes/Oz_fuzz-exec_all-features.txt @@ -33,13 +33,13 @@ [LoggingExternalInterface logging 3] [trap cast error] (module - (type ${mut:i32} (struct (field (mut i32)))) - (type $none_=>_none (func)) - (type ${i32_f64} (struct (field i32) (field f64))) - (type $[mut:i8] (array (mut i8))) + (type $struct (struct (field (mut i32)))) + (type $void_func (func)) + (type $extendedstruct (struct (field i32) (field f64))) + (type $bytes (array (mut i8))) (type $i32_=>_none (func (param i32))) (type $anyref_=>_none (func (param anyref))) - (type $none_=>_i32 (func (result i32))) + (type $int_func (func (result i32))) (import "fuzzing-support" "log-i32" (func $log (param i32))) (export "structs" (func $0)) (export "arrays" (func $1)) @@ -49,47 +49,47 @@ (export "br_on_data" (func $5)) (export "$rtt-and-cast-on-func" (func $7)) (func $0 (; has Stack IR ;) - (local $0 (ref null ${mut:i32})) + (local $0 (ref null $struct)) (call $log - (struct.get ${mut:i32} 0 + (struct.get $struct 0 (local.tee $0 - (struct.new_default_with_rtt ${mut:i32} - (rtt.canon ${mut:i32}) + (struct.new_default_with_rtt $struct + (rtt.canon $struct) ) ) ) ) - (struct.set ${mut:i32} 0 + (struct.set $struct 0 (local.get $0) (i32.const 42) ) (call $log - (struct.get ${mut:i32} 0 + (struct.get $struct 0 (local.get $0) ) ) - (struct.set ${mut:i32} 0 + (struct.set $struct 0 (local.get $0) (i32.const 100) ) (call $log - (struct.get ${mut:i32} 0 + (struct.get $struct 0 (local.get $0) ) ) (call $log - (struct.get ${mut:i32} 0 + (struct.get $struct 0 (local.get $0) ) ) ) (func $1 (; has Stack IR ;) - (local $0 (ref null $[mut:i8])) + (local $0 (ref null $bytes)) (call $log - (array.len $[mut:i8] + (array.len $bytes (local.tee $0 - (array.new_with_rtt $[mut:i8] - (rtt.canon $[mut:i8]) + (array.new_with_rtt $bytes + (rtt.canon $bytes) (i32.const 50) (i32.const 42) ) @@ -97,30 +97,30 @@ ) ) (call $log - (array.get_u $[mut:i8] + (array.get_u $bytes (local.get $0) (i32.const 10) ) ) - (array.set $[mut:i8] + (array.set $bytes (local.get $0) (i32.const 10) (i32.const 65408) ) (call $log - (array.get_u $[mut:i8] + (array.get_u $bytes (local.get $0) (i32.const 10) ) ) (call $log - (array.get_s $[mut:i8] + (array.get_s $bytes (local.get $0) (i32.const 10) ) ) (call $log - (array.get_s $[mut:i8] + (array.get_s $bytes (local.get $0) (i32.const 20) ) @@ -144,29 +144,29 @@ (i32.const 0) ) (call $log - (ref.test ${i32_f64} + (ref.test $extendedstruct (local.tee $0 - (struct.new_default_with_rtt ${i32_f64} - (rtt.sub ${i32_f64} - (rtt.canon ${mut:i32}) + (struct.new_default_with_rtt $extendedstruct + (rtt.sub $extendedstruct + (rtt.canon $struct) ) ) ) - (rtt.sub ${i32_f64} - (rtt.canon ${mut:i32}) + (rtt.sub $extendedstruct + (rtt.canon $struct) ) ) ) (call $log - (ref.test ${i32_f64} + (ref.test $extendedstruct (local.get $0) - (rtt.canon ${i32_f64}) + (rtt.canon $extendedstruct) ) ) (call $log - (ref.test ${mut:i32} + (ref.test $struct (local.get $0) - (rtt.canon ${mut:i32}) + (rtt.canon $struct) ) ) ) @@ -212,9 +212,9 @@ (i32.const 2) ) (call_ref - (ref.cast $none_=>_none + (ref.cast $void_func (ref.func $a-void-func) - (rtt.canon $none_=>_none) + (rtt.canon $void_func) ) ) (call $log @@ -222,9 +222,9 @@ ) (drop (call_ref - (ref.cast $none_=>_i32 + (ref.cast $int_func (ref.func $a-void-func) - (rtt.canon $none_=>_i32) + (rtt.canon $int_func) ) ) ) diff --git a/test/passes/asyncify.txt b/test/passes/asyncify.txt index 4137c946c..194c71ff3 100644 --- a/test/passes/asyncify.txt +++ b/test/passes/asyncify.txt @@ -1,5 +1,5 @@ (module - (type $i32_=>_none (func (param i32))) + (type $f (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) @@ -1122,7 +1122,7 @@ ) ) (block - (call_indirect (type $i32_=>_none) + (call_indirect (type $f) (local.get $2) (local.get $3) ) diff --git a/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt b/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt index dc7c3e196..63cee4395 100644 --- a/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt +++ b/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $t (func)) (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (import "env" "import" (func $import)) @@ -71,7 +71,7 @@ ) ) (block - (call_indirect (type $none_=>_none) + (call_indirect (type $t) (i32.const 0) ) (if @@ -112,7 +112,7 @@ ) (func $bar (call $nothing) - (call_indirect (type $none_=>_none) + (call_indirect (type $t) (i32.const 0) ) ) diff --git a/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt b/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt index 08eda7a63..90f7769c6 100644 --- a/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt +++ b/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $f (func)) (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (import "env" "import" (func $import)) @@ -116,7 +116,7 @@ (local.get $x) ) (block - (call_indirect (type $none_=>_none) + (call_indirect (type $f) (local.get $1) ) (if diff --git a/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt b/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt index f9ae663fd..2992c7134 100644 --- a/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt +++ b/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $f (func)) (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (import "env" "import" (func $import)) @@ -126,7 +126,7 @@ ) ) (block - (call_indirect (type $none_=>_none) + (call_indirect (type $f) (local.get $1) ) (if diff --git a/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt b/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt index 690c96030..6e73dd093 100644 --- a/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt +++ b/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $f (func)) (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (import "env" "import" (func $import)) @@ -454,7 +454,7 @@ (local.set $1 (local.get $x) ) - (call_indirect (type $none_=>_none) + (call_indirect (type $f) (local.get $1) ) ) diff --git a/test/passes/coalesce-locals-learning.txt b/test/passes/coalesce-locals-learning.txt index f7d0f5615..0c057e6b4 100644 --- a/test/passes/coalesce-locals-learning.txt +++ b/test/passes/coalesce-locals-learning.txt @@ -1,9 +1,9 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $2 (func)) + (type $4 (func (param i32))) + (type $3 (func (param i32 f32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) (memory $0 10) (func $nothing-to-do diff --git a/test/passes/coalesce-locals.txt b/test/passes/coalesce-locals.txt index a5501dbbc..2bfc48384 100644 --- a/test/passes/coalesce-locals.txt +++ b/test/passes/coalesce-locals.txt @@ -1,13 +1,13 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $2 (func)) + (type $4 (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $f64_i32_=>_i64 (func (param f64 i32) (result i64))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_f32_=>_none (func (param i32 f32))) + (type $3 (func (param i32 f32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $none_=>_f64 (func (result f64))) (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) (import "env" "get" (func $get (result i32))) diff --git a/test/passes/code-folding_enable-threads.txt b/test/passes/code-folding_enable-threads.txt index d0fd18d10..8b1ac66fd 100644 --- a/test/passes/code-folding_enable-threads.txt +++ b/test/passes/code-folding_enable-threads.txt @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) (type $none_=>_f32 (func (result f32))) - (type $f32_=>_none (func (param f32))) + (type $13 (func (param f32))) (memory $0 1 1) (table $0 282 282 funcref) (func $0 @@ -10,7 +10,7 @@ (i32.const 1) (block (block $label$3 - (call_indirect (type $f32_=>_none) + (call_indirect (type $13) (block $label$4 (br $label$3) ) @@ -141,7 +141,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (type $i32_=>_none (func (param i32))) (global $global$0 (mut i32) (i32.const 10)) (func $determinism diff --git a/test/passes/dae-optimizing.txt b/test/passes/dae-optimizing.txt index 3ae2fb25e..fca89cbc1 100644 --- a/test/passes/dae-optimizing.txt +++ b/test/passes/dae-optimizing.txt @@ -1,6 +1,6 @@ (module (type $none_=>_i32 (func (result i32))) - (type $f64_f32_f32_f64_f32_i32_i32_f64_=>_i32 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32))) + (type $2 (func (param f64 f32 f32 f64 f32 i32 i32 f64) (result i32))) (type $none_=>_f32 (func (result f32))) (global $global$0 (mut i32) (i32.const 10)) (func $0 (result i32) diff --git a/test/passes/dae_all-features.txt b/test/passes/dae_all-features.txt index 1c8c9f799..d4769ac16 100644 --- a/test/passes/dae_all-features.txt +++ b/test/passes/dae_all-features.txt @@ -259,7 +259,7 @@ ) ) (module - (type $none_=>_i32 (func (result i32))) + (type $T (func (result i32))) (type $none_=>_none (func)) (table $0 1 1 funcref) (func $foo (result i32) @@ -268,7 +268,7 @@ (i32.const 42) ) (drop - (return_call_indirect $0 (type $none_=>_i32) + (return_call_indirect $0 (type $T) (i32.const 0) ) ) diff --git a/test/passes/dce_all-features.txt b/test/passes/dce_all-features.txt index a64f033f6..a47153336 100644 --- a/test/passes/dce_all-features.txt +++ b/test/passes/dce_all-features.txt @@ -1,8 +1,8 @@ (module (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) + (type $1 (func)) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (type $f32_i64_=>_none (func (param f32 i64))) (type $f32_i64_=>_i32 (func (param f32 i64) (result i32))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) diff --git a/test/passes/directize_all-features.txt b/test/passes/directize_all-features.txt index 6b3d10b53..0e3276bb5 100644 --- a/test/passes/directize_all-features.txt +++ b/test/passes/directize_all-features.txt @@ -1,5 +1,5 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (func $foo (param $0 i32) (param $1 i32) @@ -13,7 +13,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (table $0 5 5 funcref) (elem (table $0) (i32.const 1) func $dummy) @@ -33,7 +33,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (table $1 5 5 funcref) (elem (table $1) (i32.const 4) func $foo) @@ -48,7 +48,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 0) $foo) (func $foo (param $0 i32) (param $1 i32) @@ -62,7 +62,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (table $0) (i32.const 0) func $foo $foo $foo $foo $foo) (table $1 5 5 funcref) @@ -78,14 +78,14 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (import "env" "table" (table $table 5 5 funcref)) (elem (i32.const 1) $foo) (func $foo (param $0 i32) (param $1 i32) (unreachable) ) (func $bar (param $x i32) (param $y i32) - (call_indirect $table (type $i32_i32_=>_none) + (call_indirect $table (type $ii) (local.get $x) (local.get $y) (i32.const 1) @@ -93,7 +93,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (export "tab" (table $0)) @@ -101,7 +101,7 @@ (unreachable) ) (func $bar (param $x i32) (param $y i32) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (local.get $x) (local.get $y) (i32.const 1) @@ -109,7 +109,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (global.get $g) $foo) (global $g (mut i32) (i32.const 1)) @@ -117,7 +117,7 @@ (unreachable) ) (func $bar (param $x i32) (param $y i32) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (local.get $x) (local.get $y) (i32.const 1) @@ -125,7 +125,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (table $1 5 5 funcref) (elem (table $1) (global.get $g) func $foo) @@ -134,7 +134,7 @@ (unreachable) ) (func $bar (param $x i32) (param $y i32) - (call_indirect $1 (type $i32_i32_=>_none) + (call_indirect $1 (type $ii) (local.get $x) (local.get $y) (i32.const 1) @@ -142,7 +142,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) @@ -150,7 +150,7 @@ (unreachable) ) (func $bar (param $x i32) (param $y i32) (param $z i32) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (local.get $x) (local.get $y) (local.get $z) @@ -158,7 +158,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (func $foo (param $0 i32) (param $1 i32) @@ -177,7 +177,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (func $foo (param $0 i32) (param $1 i32) @@ -197,7 +197,7 @@ ) (module (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (func $foo (param $0 i32) @@ -236,7 +236,7 @@ ) ) (module - (type $i32_i32_=>_none (func (param i32 i32))) + (type $ii (func (param i32 i32))) (table $0 5 5 funcref) (elem (i32.const 1) $foo) (func $foo (param $0 i32) (param $1 i32) diff --git a/test/passes/duplicate-function-elimination_optimize-level=1.txt b/test/passes/duplicate-function-elimination_optimize-level=1.txt index 9940ef5cf..c5f9b268e 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=1.txt +++ b/test/passes/duplicate-function-elimination_optimize-level=1.txt @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (nop) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -18,7 +18,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -27,7 +27,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -41,7 +41,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (table $0 3 3 funcref) (elem (i32.const 0) $keep2 $keep2 $caller) @@ -57,7 +57,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2-after-two-passes (nop) @@ -70,7 +70,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep-4 (nop) @@ -86,9 +86,9 @@ ) ) (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) + (type $2 (func)) + (type $3 (func (param i32))) + (type $S (func (result i32))) (memory $0 0) (func $keep4-similar-but-func-sig-differs (drop @@ -105,8 +105,8 @@ ) ) (module - (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) + (type $1 (func (param i32))) + (type $S (func (result i32))) (memory $0 0) (func $keep2-similar-but-func-sig-differs (param $i i32) (drop @@ -118,7 +118,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (nop) @@ -129,7 +129,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $block0 @@ -137,7 +137,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -150,7 +150,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $block0 @@ -159,7 +159,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -174,7 +174,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -188,7 +188,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-since-block-names-do-not-matter (block $foo @@ -196,7 +196,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-since-block-names-do-not-matter (block $foo @@ -208,7 +208,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -232,7 +232,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -250,7 +250,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $foo @@ -261,7 +261,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -279,7 +279,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (loop $bar @@ -288,7 +288,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -312,7 +312,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -325,7 +325,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $foo @@ -347,14 +347,14 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (call $erase) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2-but-in-theory-we-could-erase (call $keep2-but-in-theory-we-could-erase) @@ -364,7 +364,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) (memory $0 0) @@ -373,7 +373,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) (memory $0 0) @@ -385,45 +385,45 @@ ) ) (module - (type $none_=>_none (func)) + (type $T (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $erase $erase) (func $erase - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 0) ) ) ) (module - (type $none_=>_none (func)) + (type $T (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $keep2 $other) (func $keep2 - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 0) ) ) (func $other - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 1) ) ) ) (module - (type $none_=>_none (func)) + (type $S (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $keep2 $keep2) (func $keep2 - (call_indirect (type $none_=>_none) + (call_indirect (type $S) (i32.const 0) ) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-even-locals-with-different-names (local $i i32) @@ -433,7 +433,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -449,7 +449,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-even-locals-with-different-names (local $i i32) @@ -459,7 +459,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -475,7 +475,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -491,7 +491,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $erase (drop @@ -507,7 +507,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -525,7 +525,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -543,7 +543,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -561,7 +561,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -579,7 +579,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -597,7 +597,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $erase (i32.store @@ -611,7 +611,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store offset=3 @@ -627,7 +627,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -643,7 +643,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 @@ -659,7 +659,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -675,7 +675,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -691,7 +691,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -705,7 +705,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -719,7 +719,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -733,7 +733,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -747,7 +747,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -761,7 +761,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -775,7 +775,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -786,7 +786,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -804,7 +804,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -822,7 +822,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -834,7 +834,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -854,7 +854,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -874,7 +874,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -894,7 +894,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -907,7 +907,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -929,7 +929,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -951,7 +951,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -973,14 +973,14 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (return) ) ) (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 0) (func $erase (result i32) (return @@ -989,7 +989,7 @@ ) ) (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 0) (func $keep (result i32) (return @@ -1003,7 +1003,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -1012,7 +1012,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -1023,7 +1023,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -1041,7 +1041,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop diff --git a/test/passes/duplicate-function-elimination_optimize-level=2.txt b/test/passes/duplicate-function-elimination_optimize-level=2.txt index bf3939f67..0ab205f10 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=2.txt +++ b/test/passes/duplicate-function-elimination_optimize-level=2.txt @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (nop) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -18,7 +18,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -27,7 +27,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -41,7 +41,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (table $0 3 3 funcref) (elem (i32.const 0) $keep2 $keep2 $caller) @@ -57,7 +57,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2-after-two-passes (nop) @@ -67,7 +67,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep-4 (nop) @@ -83,9 +83,9 @@ ) ) (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) + (type $2 (func)) + (type $3 (func (param i32))) + (type $S (func (result i32))) (memory $0 0) (func $keep4-similar-but-func-sig-differs (drop @@ -102,8 +102,8 @@ ) ) (module - (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) + (type $1 (func (param i32))) + (type $S (func (result i32))) (memory $0 0) (func $keep2-similar-but-func-sig-differs (param $i i32) (drop @@ -115,7 +115,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (nop) @@ -126,7 +126,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $block0 @@ -134,7 +134,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -147,7 +147,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $block0 @@ -156,7 +156,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -171,7 +171,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $block0 @@ -185,7 +185,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-since-block-names-do-not-matter (block $foo @@ -193,7 +193,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-since-block-names-do-not-matter (block $foo @@ -205,7 +205,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -229,7 +229,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -247,7 +247,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $foo @@ -258,7 +258,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -276,7 +276,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (loop $bar @@ -285,7 +285,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -309,7 +309,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (block $foo @@ -322,7 +322,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (block $foo @@ -344,14 +344,14 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (call $erase) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2-but-in-theory-we-could-erase (call $keep2-but-in-theory-we-could-erase) @@ -361,7 +361,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) (memory $0 0) @@ -370,7 +370,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) (memory $0 0) @@ -382,45 +382,45 @@ ) ) (module - (type $none_=>_none (func)) + (type $T (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $erase $erase) (func $erase - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 0) ) ) ) (module - (type $none_=>_none (func)) + (type $T (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $keep2 $other) (func $keep2 - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 0) ) ) (func $other - (call_indirect (type $none_=>_none) + (call_indirect (type $T) (i32.const 1) ) ) ) (module - (type $none_=>_none (func)) + (type $S (func)) (memory $0 0) (table $0 2 2 funcref) (elem (i32.const 0) $keep2 $keep2) (func $keep2 - (call_indirect (type $none_=>_none) + (call_indirect (type $S) (i32.const 0) ) ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-even-locals-with-different-names (local $i i32) @@ -430,7 +430,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -446,7 +446,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase-even-locals-with-different-names (local $i i32) @@ -456,7 +456,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -472,7 +472,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (local $i i32) @@ -488,7 +488,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $erase (drop @@ -504,7 +504,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -522,7 +522,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -540,7 +540,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -558,7 +558,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -576,7 +576,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (drop @@ -594,7 +594,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $erase (i32.store @@ -608,7 +608,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store offset=3 @@ -624,7 +624,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -640,7 +640,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 @@ -656,7 +656,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -672,7 +672,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 10) (func $keep2 (i32.store16 offset=3 @@ -688,7 +688,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -702,7 +702,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -716,7 +716,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -730,7 +730,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -744,7 +744,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -758,7 +758,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -772,7 +772,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -783,7 +783,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -801,7 +801,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -819,7 +819,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -831,7 +831,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -851,7 +851,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -871,7 +871,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep2 (drop @@ -891,7 +891,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -904,7 +904,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -926,7 +926,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -948,7 +948,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -970,14 +970,14 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (return) ) ) (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 0) (func $erase (result i32) (return @@ -986,7 +986,7 @@ ) ) (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 0) (func $keep (result i32) (return @@ -1000,7 +1000,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -1009,7 +1009,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $erase (drop @@ -1020,7 +1020,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop @@ -1038,7 +1038,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $keep (drop diff --git a/test/passes/flatten_all-features.txt b/test/passes/flatten_all-features.txt index 192c9ad82..efcce6797 100644 --- a/test/passes/flatten_all-features.txt +++ b/test/passes/flatten_all-features.txt @@ -1,10 +1,10 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $2 (func (result i32))) + (type $1 (func)) + (type $ii (func (param i32 i32))) + (type $3 (func (param i32) (result i32))) (type $none_=>_f32 (func (result f32))) - (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) + (type $4 (func (param i64 i64) (result i64))) (type $none_=>_anyref (func (result anyref))) (memory $0 10) (table $0 1 1 funcref) @@ -1050,7 +1050,7 @@ (i32.const -1) (block (unreachable) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 123) (i32.const 456) (unreachable) @@ -1062,7 +1062,7 @@ (i32.const -2) (block (unreachable) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 139) (unreachable) (i32.const 0) @@ -1075,7 +1075,7 @@ (block (unreachable) (unreachable) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 246) (unreachable) (unreachable) @@ -1089,7 +1089,7 @@ (unreachable) (unreachable) (unreachable) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (unreachable) (unreachable) (unreachable) diff --git a/test/passes/flatten_local-cse_all-features.txt b/test/passes/flatten_local-cse_all-features.txt index ad051c5e2..ffd2b7945 100644 --- a/test/passes/flatten_local-cse_all-features.txt +++ b/test/passes/flatten_local-cse_all-features.txt @@ -580,9 +580,9 @@ ) ) (module - (type $none_=>_none (func)) - (type $i64_f32_i32_=>_none (func (param i64 f32 i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $0 (func)) + (type $2 (func (param i64 f32 i32))) + (type $1 (func (param i32 f64) (result i32))) (table $0 23 23 funcref) (global $global$0 (mut i32) (i32.const 10)) (export "func_1_invoker" (func $1)) diff --git a/test/passes/flatten_rereloop.txt b/test/passes/flatten_rereloop.txt index c0b406816..fc4b49ace 100644 --- a/test/passes/flatten_rereloop.txt +++ b/test/passes/flatten_rereloop.txt @@ -392,10 +392,10 @@ ) ) (module - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) + (type $3 (func (param i32))) + (type $0 (func)) + (type $2 (func (param i32) (result i32))) + (type $1 (func (result i32))) (func $trivial (local $0 i32) (return) diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt index 5969fc63a..fbb18114e 100644 --- a/test/passes/fpcast-emu.txt +++ b/test/passes/fpcast-emu.txt @@ -1,11 +1,11 @@ (module (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64))) - (type $i32_i64_f32_f64_=>_none (func (param i32 i64 f32 f64))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $vijfd (func (param i32 i64 f32 f64))) + (type $idd (func (param f64 f64) (result i32))) + (type $jii (func (param i32 i32) (result i64))) (type $i32_i64_f32_f64_=>_f32 (func (param i32 i64 f32 f64) (result f32))) - (type $i64_i64_=>_f32 (func (param i64 i64) (result f32))) - (type $f32_f32_=>_f64 (func (param f32 f32) (result f64))) + (type $fjj (func (param i64 i64) (result f32))) + (type $dff (func (param f32 f32) (result f64))) (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32))) (table $0 10 10 funcref) (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b $byn$fpcast-emu$c $byn$fpcast-emu$d $byn$fpcast-emu$e $byn$fpcast-emu$e $byn$fpcast-emu$imported-func) @@ -235,7 +235,7 @@ ) ) (module - (type $f32_=>_i64 (func (param f32) (result i64))) + (type $1 (func (param f32) (result i64))) (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64))) (table $0 42 42 funcref) (global $global$0 (mut i32) (i32.const 10)) diff --git a/test/passes/fpcast-emu_pass-arg=max-func-params@5.txt b/test/passes/fpcast-emu_pass-arg=max-func-params@5.txt index 4382aaca0..dd3d5abe7 100644 --- a/test/passes/fpcast-emu_pass-arg=max-func-params@5.txt +++ b/test/passes/fpcast-emu_pass-arg=max-func-params@5.txt @@ -1,6 +1,6 @@ (module (type $i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64) (result i64))) - (type $i32_i64_f32_f64_=>_none (func (param i32 i64 f32 f64))) + (type $vijfd (func (param i32 i64 f32 f64))) (table $0 10 10 funcref) (elem (i32.const 0) $byn$fpcast-emu$a) (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64) diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt index 75ff9dcf2..b224c980c 100644 --- a/test/passes/func-metrics.txt +++ b/test/passes/func-metrics.txt @@ -34,7 +34,7 @@ func: ifs If : 4 (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (memory $0 256 256) (data (i32.const 0) "\ff\ef\0f\1f 0@P\99") (table $0 256 256 funcref) @@ -256,7 +256,7 @@ export: stackSave (0) [removable-bytes-without-it]: 56 [total] : 0 (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (import "env" "STACKTOP" (global $gimport$0 i32)) (global $global$0 (mut i32) (global.get $gimport$0)) (export "stackSave" (func $0)) diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt index 9a0ec41ec..6dc837c58 100644 --- a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt +++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt @@ -1,14 +1,14 @@ (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $f32_=>_none (func (param f32))) - (type $none_=>_f64 (func (result f64))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $none_=>_i64 (func (result i64))) - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $FUNCSIG$v (func)) + (type $5 (func (result i32))) + (type $6 (func (param i32) (result i32))) + (type $FUNCSIG$vf (func (param f32))) + (type $4 (func (result f64))) + (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $9 (func (param i32 i64))) + (type $FUNCSIG$id (func (param f64) (result i32))) + (type $8 (func (result i64))) + (type $7 (func (param f64) (result f64))) (import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi)) (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32))) (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64))) @@ -629,16 +629,16 @@ ) ) (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $f32_=>_none (func (param f32))) - (type $none_=>_f64 (func (result f64))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $none_=>_i64 (func (result i64))) - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $FUNCSIG$v (func)) + (type $5 (func (result i32))) + (type $6 (func (param i32) (result i32))) + (type $FUNCSIG$vf (func (param f32))) + (type $4 (func (result f64))) + (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $9 (func (param i32 i64))) + (type $FUNCSIG$id (func (param f64) (result i32))) + (type $8 (func (result i64))) + (type $7 (func (param f64) (result f64))) (import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi)) (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32))) (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64))) @@ -1009,7 +1009,7 @@ (local.get $x) ) ) - (call_indirect (type $f32_=>_none) + (call_indirect (type $FUNCSIG$vf) (local.get $x) (i32.add (i32.and @@ -1022,7 +1022,7 @@ ) ) (func $cneg (; has Stack IR ;) (param $x f32) - (call_indirect (type $f32_=>_none) + (call_indirect (type $FUNCSIG$vf) (local.get $x) (i32.add (i32.and diff --git a/test/passes/inlining-optimizing_enable-threads.txt b/test/passes/inlining-optimizing_enable-threads.txt index 1a1462ba6..42ca6fb30 100644 --- a/test/passes/inlining-optimizing_enable-threads.txt +++ b/test/passes/inlining-optimizing_enable-threads.txt @@ -71,7 +71,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 17) (table $0 89 89 funcref) (start $1) diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt index c63b3baa3..d6c17620c 100644 --- a/test/passes/inlining-optimizing_optimize-level=3.txt +++ b/test/passes/inlining-optimizing_optimize-level=3.txt @@ -1,12 +1,12 @@ (module - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$i (func (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) @@ -1218,7 +1218,7 @@ (local.get $11) (block (drop - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $0) (i32.const 0) (i32.const 0) @@ -1352,7 +1352,7 @@ ) (block $block30 (local.set $3 - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $2) (local.get $0) (local.get $1) @@ -1417,7 +1417,7 @@ ) (br_if $label$break$L5 (i32.lt_u - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $2) (local.get $0) (local.get $3) @@ -2026,7 +2026,7 @@ ) ) (drop - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $0) (i32.const 0) (i32.const 0) @@ -2074,7 +2074,7 @@ ) ) (drop - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $0) (i32.sub (local.get $4) @@ -15384,7 +15384,7 @@ ) ) (func $dynCall_ii (param $0 i32) (param $1 i32) (result i32) - (call_indirect (type $i32_=>_i32) + (call_indirect (type $FUNCSIG$ii) (local.get $1) (i32.and (local.get $0) @@ -15393,7 +15393,7 @@ ) ) (func $dynCall_iiii (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $1) (local.get $2) (local.get $3) @@ -15407,7 +15407,7 @@ ) ) (func $dynCall_vi (param $0 i32) (param $1 i32) - (call_indirect (type $i32_=>_none) + (call_indirect (type $FUNCSIG$vi) (local.get $1) (i32.add (i32.and diff --git a/test/passes/inlining_enable-tail-call.txt b/test/passes/inlining_enable-tail-call.txt index 56dd8d30e..2092d70c2 100644 --- a/test/passes/inlining_enable-tail-call.txt +++ b/test/passes/inlining_enable-tail-call.txt @@ -230,11 +230,11 @@ ) (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $T (func (param i32))) (table $0 10 funcref) (func $0 (block $__inlined_func$1 - (call_indirect (type $i32_=>_none) + (call_indirect (type $T) (if (result i32) (i32.const 0) (unreachable) @@ -344,14 +344,14 @@ ) (module (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $T (func (param i32) (result i32))) (table $0 10 funcref) (func $0 (drop (block (result i32) (block $__inlined_func$1 (result i32) (br $__inlined_func$1 - (call_indirect (type $i32_=>_i32) + (call_indirect (type $T) (i32.const 42) (i32.const 0) ) @@ -363,12 +363,12 @@ ) (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $T (func (param i32))) (table $0 10 funcref) (func $0 (block $__inlined_func$1 (block - (call_indirect (type $i32_=>_none) + (call_indirect (type $T) (i32.const 42) (i32.const 0) ) @@ -379,7 +379,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $6 (func)) (memory $0 1 1) (global $global$0 (mut i32) (i32.const 10)) (export "func_102_invoker" (func $19)) diff --git a/test/passes/instrument-memory.txt b/test/passes/instrument-memory.txt index e14569c24..d4b10e177 100644 --- a/test/passes/instrument-memory.txt +++ b/test/passes/instrument-memory.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $1 (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) diff --git a/test/passes/instrument-memory64.txt b/test/passes/instrument-memory64.txt index 0ef357223..7480349af 100644 --- a/test/passes/instrument-memory64.txt +++ b/test/passes/instrument-memory64.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $1 (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i64_i64_=>_i64 (func (param i32 i32 i64 i64) (result i64))) (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) diff --git a/test/passes/metrics_all-features.txt b/test/passes/metrics_all-features.txt index 0a22ac945..ae746355d 100644 --- a/test/passes/metrics_all-features.txt +++ b/test/passes/metrics_all-features.txt @@ -15,7 +15,7 @@ total Drop : 6 If : 4 (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (memory $0 256 256) (data (i32.const 0) "\ff\ef\0f\1f 0@P\99") diff --git a/test/passes/nm.txt b/test/passes/nm.txt index ae16b54be..808bcb0e1 100644 --- a/test/passes/nm.txt +++ b/test/passes/nm.txt @@ -2,7 +2,7 @@ b : 5 c : 13 (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $a (nop) diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt index c22711cb9..b35bef77d 100644 --- a/test/passes/precompute_all-features.txt +++ b/test/passes/precompute_all-features.txt @@ -3,7 +3,7 @@ (type $none_=>_i32 (func (result i32))) (type $none_=>_f64 (func (result f64))) (type $none_=>_v128 (func (result v128))) - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (type $none_=>_externref (func (result externref))) (type $none_=>_i32_i64 (func (result i32 i64))) (memory $0 512 512) diff --git a/test/passes/print-call-graph.txt b/test/passes/print-call-graph.txt index 48993a4de..0011fb16b 100644 --- a/test/passes/print-call-graph.txt +++ b/test/passes/print-call-graph.txt @@ -112,13 +112,13 @@ digraph call { "b3" [style="filled, rounded"]; } (module - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "memory" (memory $0 256 256)) (data (global.get $memoryBase) "\05\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04") @@ -979,7 +979,7 @@ digraph call { ) ) (drop - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $0) (i32.const 0) (i32.const 0) @@ -1027,7 +1027,7 @@ digraph call { ) ) (drop - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $0) (i32.sub (local.get $4) @@ -1092,7 +1092,7 @@ digraph call { (call $__ZSt15get_new_handlerv) ) (block $block - (call_indirect (type $none_=>_none) + (call_indirect (type $FUNCSIG$v) (i32.add (i32.and (local.get $0) @@ -1420,7 +1420,7 @@ digraph call { (i32.const 0) ) (func $dynCall_ii (param $0 i32) (param $1 i32) (result i32) - (call_indirect (type $i32_=>_i32) + (call_indirect (type $FUNCSIG$ii) (local.get $1) (i32.add (i32.and @@ -1432,7 +1432,7 @@ digraph call { ) ) (func $dynCall_iiii (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (call_indirect (type $i32_i32_i32_=>_i32) + (call_indirect (type $FUNCSIG$iiii) (local.get $1) (local.get $2) (local.get $3) @@ -1446,7 +1446,7 @@ digraph call { ) ) (func $dynCall_vi (param $0 i32) (param $1 i32) - (call_indirect (type $i32_=>_none) + (call_indirect (type $FUNCSIG$vi) (local.get $1) (i32.add (i32.and @@ -1458,7 +1458,7 @@ digraph call { ) ) (func $dynCall_v (param $0 i32) - (call_indirect (type $none_=>_none) + (call_indirect (type $FUNCSIG$v) (i32.add (i32.and (local.get $0) diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt index 40758ca27..641e57723 100644 --- a/test/passes/remove-imports.txt +++ b/test/passes/remove-imports.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (import "env" "table" (table $table 1 1 funcref)) (elem (i32.const 0) $waka-sneaky) (import "env" "memBase" (global $gimport$0 i32)) @@ -13,7 +13,7 @@ (drop (f64.const 0) ) - (call_indirect (type $none_=>_none) + (call_indirect (type $FUNCSIG$v) (i32.const 0) ) ) diff --git a/test/passes/remove-unused-brs_enable-multivalue.txt b/test/passes/remove-unused-brs_enable-multivalue.txt index de4109665..f48f7b6af 100644 --- a/test/passes/remove-unused-brs_enable-multivalue.txt +++ b/test/passes/remove-unused-brs_enable-multivalue.txt @@ -1,7 +1,7 @@ (module - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) + (type $0 (func (param i32))) + (type $1 (func)) + (type $2 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32_i64 (func (result i32 i64))) diff --git a/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt index c87545d9e..c9cacca39 100644 --- a/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt +++ b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt @@ -1,5 +1,5 @@ (module - (type $i64_=>_none (func (param i64))) + (type $0 (func (param i64))) (func $0 (param $var$0 i64) block $label$1 block $label$2 @@ -16,7 +16,7 @@ ) ) (module - (type $i64_=>_none (func (param i64))) + (type $0 (func (param i64))) (func $0 (; has Stack IR ;) (param $var$0 i64) (block $label$1 (br_if $label$1 diff --git a/test/passes/remove-unused-brs_shrink-level=1.txt b/test/passes/remove-unused-brs_shrink-level=1.txt index 62491431f..22f70fff1 100644 --- a/test/passes/remove-unused-brs_shrink-level=1.txt +++ b/test/passes/remove-unused-brs_shrink-level=1.txt @@ -1,6 +1,6 @@ (module - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) + (type $2 (func (result i32))) + (type $1 (func)) (memory $0 256 256) (func $b14 (result i32) (drop diff --git a/test/passes/remove-unused-brs_shrink-level=1_ignore-implicit-traps.txt b/test/passes/remove-unused-brs_shrink-level=1_ignore-implicit-traps.txt index 5e659d2c9..ed4dab47b 100644 --- a/test/passes/remove-unused-brs_shrink-level=1_ignore-implicit-traps.txt +++ b/test/passes/remove-unused-brs_shrink-level=1_ignore-implicit-traps.txt @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) + (type $1 (func)) + (type $2 (func (result i32))) (memory $0 256 256) (func $b14 (result i32) (drop diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt index 96fbb8c99..c2f86125d 100644 --- a/test/passes/remove-unused-module-elements_all-features.txt +++ b/test/passes/remove-unused-module-elements_all-features.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func)) + (type $1 (func (param i32))) + (type $2 (func (param i32) (result i32))) (memory $0 0) (table $0 1 1 funcref) (elem (i32.const 0) $called_indirect) @@ -36,40 +36,40 @@ (call $called3) ) (func $other1 (param $0 i32) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $i32_=>_none) + (call_indirect $0 (type $1) (i32.const 0) (i32.const 0) ) - (call_indirect $0 (type $i32_=>_none) + (call_indirect $0 (type $1) (i32.const 0) (i32.const 0) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) @@ -112,7 +112,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "memory" (memory $0 256)) (import "env" "table" (table $timport$0 0 funcref)) (export "user" (func $user)) @@ -122,7 +122,7 @@ (i32.const 0) ) ) - (call_indirect $timport$0 (type $none_=>_none) + (call_indirect $timport$0 (type $0) (i32.const 0) ) ) @@ -276,7 +276,7 @@ (module ) (module - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $0 (func (param f64) (result f64))) (import "env" "table" (table $timport$0 6 6 funcref)) (elem (i32.const 0) $0) (func $0 (param $var$0 f64) (result f64) @@ -291,7 +291,7 @@ ) ) (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (type $none_=>_none (func)) (type $i64_=>_none (func (param i64))) (event $e-export (attr 0) (param i64)) diff --git a/test/passes/remove-unused-names.txt b/test/passes/remove-unused-names.txt index 43950ca26..63d257770 100644 --- a/test/passes/remove-unused-names.txt +++ b/test/passes/remove-unused-names.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) + (type $1 (func)) (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i32) (result i32))) (memory $0 256 256) (func $b0 (param $i1 i32) (result i32) (i32.const 0) diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.txt b/test/passes/remove-unused-names_merge-blocks_all-features.txt index 774715e02..2c06634d2 100644 --- a/test/passes/remove-unused-names_merge-blocks_all-features.txt +++ b/test/passes/remove-unused-names_merge-blocks_all-features.txt @@ -1,9 +1,9 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) + (type $3 (func)) + (type $i (func (param i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $ii (func (param i32 i32))) + (type $iii (func (param i32 i32 i32))) (type $none_=>_f64 (func (result f64))) (memory $0 (shared 256 256)) (table $0 1 1 funcref) @@ -694,12 +694,12 @@ (drop (i32.const 50) ) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 20) (i32.const 40) (i32.const 60) ) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (unreachable) (block (result i32) (drop @@ -717,7 +717,7 @@ (drop (i32.const 31) ) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 41) (unreachable) (block (result i32) @@ -733,7 +733,7 @@ (drop (i32.const 52) ) - (call_indirect $0 (type $i32_i32_=>_none) + (call_indirect $0 (type $ii) (i32.const 42) (i32.const 62) (unreachable) diff --git a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt index 0962038f9..0c38028d7 100644 --- a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt +++ b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt @@ -1,12 +1,12 @@ (module - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) + (type $4 (func (param i32))) + (type $2 (func (param i32 i32) (result i32))) + (type $5 (func (result i32))) + (type $0 (func (param i32 i32 i32) (result i32))) + (type $6 (func)) + (type $7 (func (param i32 i32))) + (type $13 (func (param i32 i32 i32 i32 i32))) + (type $1 (func (param f64) (result i32))) (type $i32_=>_i64 (func (param i32) (result i64))) (import "env" "memory" (memory $0 256)) (import "env" "table" (table $timport$0 18 18 funcref)) diff --git a/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt b/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt index 1f97a71cd..b422798c7 100644 --- a/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt +++ b/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt @@ -1,7 +1,7 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) + (type $FUNCSIG$vj (func (param i32 i32))) + (type $FUNCSIG$i (func (result i32))) + (type $0 (func)) (type $i64_=>_none (func (param i64))) (type $f32_=>_none (func (param f32))) (type $f64_=>_none (func (param f64))) diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt index 76d388b23..8df4d1ec9 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func)) + (type $1 (func (param i32))) + (type $2 (func (param i32) (result i32))) (memory $0 0) (table $0 1 1 funcref) (elem (i32.const 0) $called_indirect) @@ -51,40 +51,40 @@ (call $remove3) ) (func $other1 (param $0 i32) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $none_=>_none) + (call_indirect $0 (type $0) (i32.const 0) ) - (call_indirect $0 (type $i32_=>_none) + (call_indirect $0 (type $1) (i32.const 0) (i32.const 0) ) - (call_indirect $0 (type $i32_=>_none) + (call_indirect $0 (type $1) (i32.const 0) (i32.const 0) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) ) (drop - (call_indirect $0 (type $i32_=>_i32) + (call_indirect $0 (type $2) (i32.const 0) (i32.const 0) ) @@ -115,7 +115,7 @@ ) ) (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "memory" (memory $0 256)) (import "env" "table" (table $timport$0 0 funcref)) (export "user" (func $user)) @@ -125,7 +125,7 @@ (i32.const 0) ) ) - (call_indirect $timport$0 (type $none_=>_none) + (call_indirect $timport$0 (type $0) (i32.const 0) ) ) @@ -285,7 +285,7 @@ ) ) (module - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $0 (func (param f64) (result f64))) (func $0 (param $var$0 f64) (result f64) (if (result f64) (f64.eq @@ -298,7 +298,7 @@ ) ) (module - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $0 (func (param f64) (result f64))) (table $0 6 6 funcref) (func $0 (param $var$0 f64) (result f64) (if (result f64) @@ -306,7 +306,7 @@ (f64.const 1) (f64.const 1) ) - (call_indirect $0 (type $f64_=>_f64) + (call_indirect $0 (type $0) (f64.const 1) (i32.const 0) ) @@ -315,7 +315,7 @@ ) ) (module - (type $f64_=>_f64 (func (param f64) (result f64))) + (type $0 (func (param f64) (result f64))) (import "env" "table" (table $timport$0 6 6 funcref)) (elem (i32.const 0) $0) (func $0 (param $var$0 f64) (result f64) @@ -330,7 +330,7 @@ ) ) (module - (type $i32_=>_none (func (param i32))) + (type $0 (func (param i32))) (type $i64_=>_none (func (param i64))) (event $e1 (attr 0) (param i64)) (export "e1" (event $e1)) diff --git a/test/passes/reorder-functions.txt b/test/passes/reorder-functions.txt index 2dd10eedb..985a90f57 100644 --- a/test/passes/reorder-functions.txt +++ b/test/passes/reorder-functions.txt @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 256 256) (func $c (call $c) diff --git a/test/passes/reorder-locals.txt b/test/passes/reorder-locals.txt index d2ffb188c..b202dc337 100644 --- a/test/passes/reorder-locals.txt +++ b/test/passes/reorder-locals.txt @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) + (type $1 (func)) + (type $0 (func (param i32 i32))) (memory $0 256 256) (func $b0-yes (param $a i32) (param $b i32) (local $z i32) diff --git a/test/passes/safe-heap_enable-threads_enable-simd.txt b/test/passes/safe-heap_enable-threads_enable-simd.txt index 75a39591b..0dd7bfbc9 100644 --- a/test/passes/safe-heap_enable-threads_enable-simd.txt +++ b/test/passes/safe-heap_enable-threads_enable-simd.txt @@ -5434,7 +5434,7 @@ (type $i32_i32_=>_v128 (func (param i32 i32) (result v128))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $none_=>_i32 (func (result i32))) diff --git a/test/passes/safe-heap_enable-threads_enable-simd64.txt b/test/passes/safe-heap_enable-threads_enable-simd64.txt index ed2365902..4f7b24882 100644 --- a/test/passes/safe-heap_enable-threads_enable-simd64.txt +++ b/test/passes/safe-heap_enable-threads_enable-simd64.txt @@ -5620,7 +5620,7 @@ (type $i64_i64_=>_v128 (func (param i64 i64) (result v128))) (type $i64_i64_f64_=>_none (func (param i64 i64 f64))) (type $i64_i64_=>_f64 (func (param i64 i64) (result f64))) - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (type $i64_i64_f32_=>_none (func (param i64 i64 f32))) (type $i64_i64_=>_f32 (func (param i64 i64) (result f32))) (type $none_=>_i64 (func (result i64))) diff --git a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt index 36a812027..7b5c51ccd 100644 --- a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt +++ b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt @@ -5434,7 +5434,7 @@ (type $i32_i32_=>_v128 (func (param i32 i32) (result v128))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $none_=>_none (func)) + (type $FUNCSIG$v (func)) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $none_=>_i32 (func (result i32))) diff --git a/test/passes/simplify-locals-nonesting.txt b/test/passes/simplify-locals-nonesting.txt index efada338f..8cae72beb 100644 --- a/test/passes/simplify-locals-nonesting.txt +++ b/test/passes/simplify-locals-nonesting.txt @@ -1,6 +1,6 @@ (module - (type $i64_i64_i64_=>_i32 (func (param i64 i64 i64) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $0 (func (param i64 i64 i64) (result i32))) + (type $1 (func (param i32) (result i32))) (func $figure-1a (param $a i64) (param $x i64) (param $y i64) (result i32) (local $i i32) (local $j i32) diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt index 21361af65..eab7faa19 100644 --- a/test/passes/simplify-locals_all-features.txt +++ b/test/passes/simplify-locals_all-features.txt @@ -1,16 +1,16 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) + (type $5 (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $6 (func (param i32 i32 i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $4 (func (param i32))) (type $i64_=>_none (func (param i64))) (type $f32_=>_none (func (param f32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_f64_f64_f32_i32_=>_f64 (func (param i32 f64 f64 f32 i32) (result f64))) (import "env" "waka" (func $waka)) (import "env" "waka_int" (func $waka_int (result i32))) @@ -1122,11 +1122,11 @@ ) ) (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $5 (func (param i32) (result i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $4 (func (param i32))) (type $f32_=>_none (func (param f32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) diff --git a/test/passes/simplify-locals_all-features_disable-exception-handling.txt b/test/passes/simplify-locals_all-features_disable-exception-handling.txt index e3ff658a7..92f4deb2c 100644 --- a/test/passes/simplify-locals_all-features_disable-exception-handling.txt +++ b/test/passes/simplify-locals_all-features_disable-exception-handling.txt @@ -1,16 +1,16 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) + (type $5 (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $6 (func (param i32 i32 i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $4 (func (param i32))) (type $i64_=>_none (func (param i64))) (type $f32_=>_none (func (param f32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_f64_f64_f32_i32_=>_f64 (func (param i32 f64 f64 f32 i32) (result f64))) (import "env" "waka" (func $waka)) (import "env" "waka_int" (func $waka_int (result i32))) @@ -1116,11 +1116,11 @@ ) ) (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $5 (func (param i32) (result i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $4 (func (param i32))) (type $f32_=>_none (func (param f32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) diff --git a/test/passes/ssa_fuzz-exec_enable-threads.txt b/test/passes/ssa_fuzz-exec_enable-threads.txt index b8e9e9cf6..40845e209 100644 --- a/test/passes/ssa_fuzz-exec_enable-threads.txt +++ b/test/passes/ssa_fuzz-exec_enable-threads.txt @@ -1,7 +1,7 @@ [fuzz-exec] calling func_0 [fuzz-exec] note result: func_0 => 16384 (module - (type $none_=>_i32 (func (result i32))) + (type $0 (func (result i32))) (memory $0 (shared 1 1)) (table $0 0 0 funcref) (export "func_0" (func $0)) diff --git a/test/passes/vacuum_all-features.txt b/test/passes/vacuum_all-features.txt index 9acd26665..740c7a2eb 100644 --- a/test/passes/vacuum_all-features.txt +++ b/test/passes/vacuum_all-features.txt @@ -1,9 +1,9 @@ (module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_f32 (func (result f32))) - (type $i32_f64_i32_i32_=>_none (func (param i32 f64 i32 i32))) + (type $0 (func)) + (type $3 (func (result i32))) + (type $1 (func (param i32))) + (type $2 (func (result f32))) + (type $4 (func (param i32 f64 i32 i32))) (type $none_=>_f64 (func (result f64))) (import "env" "int" (func $int (result i32))) (memory $0 256 256) @@ -299,8 +299,8 @@ ) ) (module - (type $i64_=>_none (func (param i64))) - (type $f32_i32_=>_i32 (func (param f32 i32) (result i32))) + (type $0 (func (param i64))) + (type $1 (func (param f32 i32) (result i32))) (func $0 (param $0 i64) (nop) ) diff --git a/test/polymorphic_stack.wast.from-wast b/test/polymorphic_stack.wast.from-wast index be9cb82bd..634a634f7 100644 --- a/test/polymorphic_stack.wast.from-wast +++ b/test/polymorphic_stack.wast.from-wast @@ -1,6 +1,6 @@ (module (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (import "env" "table" (table $timport$0 9 9 funcref)) @@ -36,7 +36,7 @@ ) (drop (i64.eqz - (call_indirect $timport$0 (type $i32_=>_i32) + (call_indirect $timport$0 (type $FUNCSIG$ii) (unreachable) (unreachable) ) diff --git a/test/print/min.minified.txt b/test/print/min.minified.txt index 69b686301..adb0c6cf6 100644 --- a/test/print/min.minified.txt +++ b/test/print/min.minified.txt @@ -1,4 +1,4 @@ -(module(type $i32_=>_i32 (func(param i32)(result i32)))(type $i32_i32_i32_=>_i32 (func(param i32 i32 i32)(result i32)))(type $f32_=>_f32 (func(param f32)(result f32)))(type $i32_i32_=>_f32 (func(param i32 i32)(result f32)))(memory $0 256 256) +(module(type $2 (func(param i32)(result i32)))(type $3 (func(param i32 i32 i32)(result i32)))(type $0 (func(param f32)(result f32)))(type $1 (func(param i32 i32)(result f32)))(memory $0 256 256) (export "floats" (func $floats))(func $floats(param $f f32)(result f32)(local $t f32)(f32.add(local.get $t)(local.get $f)))(func $neg(param $k i32)(param $p i32)(result f32)(local $n f32)(local.tee $n(f32.neg(block $block0 (result f32)(i32.store(local.get $k)(local.get $p))(f32.load(local.get $k))))))(func $littleswitch(param $x i32)(result i32)(block $topmost (result i32)(block $switch-case$2(block $switch-case$1(br_table $switch-case$1 $switch-case$2 $switch-case$1(i32.sub(local.get $x)(i32.const 1)))) (br $topmost(i32.const 1))) (br $topmost(i32.const 2))(i32.const 0)))(func $f1(param $i1 i32)(param $i2 i32)(param $i3 i32)(result i32)(block $topmost (result i32)(local.get $i3))))
\ No newline at end of file diff --git a/test/print/min.txt b/test/print/min.txt index 3998f43b4..f5cf0d199 100644 --- a/test/print/min.txt +++ b/test/print/min.txt @@ -1,8 +1,8 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $f32_=>_f32 (func (param f32) (result f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $2 (func (param i32) (result i32))) + (type $3 (func (param i32 i32 i32) (result i32))) + (type $0 (func (param f32) (result f32))) + (type $1 (func (param i32 i32) (result f32))) (memory $0 256 256) (export "floats" (func $floats)) (func $floats (param $f f32) (result f32) diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast index 9a89da4db..1ccdc4d52 100644 --- a/test/reference-types.wast.from-wast +++ b/test/reference-types.wast.from-wast @@ -1,9 +1,9 @@ (module (type $none_=>_anyref (func (result anyref))) - (type $anyref_=>_none (func (param anyref))) - (type $funcref_=>_none (func (param funcref))) + (type $sig_anyref (func (param anyref))) + (type $sig_funcref (func (param funcref))) (type $none_=>_funcref (func (result funcref))) - (type $externref_=>_none (func (param externref))) + (type $sig_externref (func (param externref))) (type $none_=>_externref (func (result externref))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) @@ -191,71 +191,71 @@ (call $take_anyref (ref.func $foo) ) - (call_indirect $0 (type $externref_=>_none) + (call_indirect $0 (type $sig_externref) (local.get $local_externref) (i32.const 0) ) - (call_indirect $0 (type $externref_=>_none) + (call_indirect $0 (type $sig_externref) (global.get $global_externref) (i32.const 0) ) - (call_indirect $0 (type $externref_=>_none) + (call_indirect $0 (type $sig_externref) (ref.null extern) (i32.const 0) ) - (call_indirect $0 (type $funcref_=>_none) + (call_indirect $0 (type $sig_funcref) (local.get $local_funcref) (i32.const 1) ) - (call_indirect $0 (type $funcref_=>_none) + (call_indirect $0 (type $sig_funcref) (global.get $global_funcref) (i32.const 1) ) - (call_indirect $0 (type $funcref_=>_none) + (call_indirect $0 (type $sig_funcref) (ref.null func) (i32.const 1) ) - (call_indirect $0 (type $funcref_=>_none) + (call_indirect $0 (type $sig_funcref) (ref.func $foo) (i32.const 1) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (local.get $local_anyref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (global.get $global_anyref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (ref.null any) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (local.get $local_externref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (global.get $global_externref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (ref.null extern) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (local.get $local_funcref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (global.get $global_funcref) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (ref.null func) (i32.const 3) ) - (call_indirect $0 (type $anyref_=>_none) + (call_indirect $0 (type $sig_anyref) (ref.func $foo) (i32.const 3) ) diff --git a/test/reg_switch.wast.from-wast b/test/reg_switch.wast.from-wast index 868c25e42..74b69d9b0 100644 --- a/test/reg_switch.wast.from-wast +++ b/test/reg_switch.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (memory $0 0) (func $0 (if diff --git a/test/signext.wast.from-wast b/test/signext.wast.from-wast index 7f8e4ff79..c26938c06 100644 --- a/test/signext.wast.from-wast +++ b/test/signext.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (func $signext (local $0 i32) (local $1 i64) diff --git a/test/subtypes.wast.from-wast b/test/subtypes.wast.from-wast index 249421578..db4d69f6d 100644 --- a/test/subtypes.wast.from-wast +++ b/test/subtypes.wast.from-wast @@ -1,30 +1,30 @@ (module - (type ${ref?|i31|} (struct (field (ref null i31)))) - (type $[i32] (array i32)) - (type $ref?|{ref?|i31|}|_ref?|{anyref}|_=>_none (func (param (ref null ${ref?|i31|}) (ref null ${anyref})))) - (type $ref?|{ref?|i31|}|_ref?|{ref?|i31|_anyref}|_=>_none (func (param (ref null ${ref?|i31|}) (ref null ${ref?|i31|_anyref})))) - (type $ref?|[i32]|_ref?|[i32]|_=>_none (func (param (ref null $[i32]) (ref null $[i32])))) - (type $ref?|[ref?|i31|]|_ref?|[anyref]|_=>_none (func (param (ref null $[ref?|i31|]) (ref null $[anyref])))) - (type ${anyref} (struct (field anyref))) - (type ${ref?|i31|_anyref} (struct (field (ref null i31)) (field anyref))) - (type $[anyref] (array anyref)) - (type $[ref?|i31|] (array (ref null i31))) - (func $foo (param $no-null (ref null $[i32])) (param $yes-null (ref null $[i32])) + (type $struct-i31 (struct (field (ref null i31)))) + (type $vector-i32 (array i32)) + (type $ref?|$struct-i31|_ref?|$struct-any|_=>_none (func (param (ref null $struct-i31) (ref null $struct-any)))) + (type $ref?|$struct-i31|_ref?|$struct-i31_any|_=>_none (func (param (ref null $struct-i31) (ref null $struct-i31_any)))) + (type $ref?|$vector-i32|_ref?|$vector-i32|_=>_none (func (param (ref null $vector-i32) (ref null $vector-i32)))) + (type $ref?|$vector-i31|_ref?|$vector-any|_=>_none (func (param (ref null $vector-i31) (ref null $vector-any)))) + (type $struct-any (struct (field anyref))) + (type $struct-i31_any (struct (field (ref null i31)) (field anyref))) + (type $vector-any (array anyref)) + (type $vector-i31 (array (ref null i31))) + (func $foo (param $no-null (ref null $vector-i32)) (param $yes-null (ref null $vector-i32)) (local.set $no-null (local.get $yes-null) ) ) - (func $bar (param $v-i31 (ref null $[ref?|i31|])) (param $v-any (ref null $[anyref])) + (func $bar (param $v-i31 (ref null $vector-i31)) (param $v-any (ref null $vector-any)) (local.set $v-any (local.get $v-i31) ) ) - (func $baz (param $s-i31 (ref null ${ref?|i31|})) (param $s-any (ref null ${anyref})) + (func $baz (param $s-i31 (ref null $struct-i31)) (param $s-any (ref null $struct-any)) (local.set $s-any (local.get $s-i31) ) ) - (func $boo (param $s-i31 (ref null ${ref?|i31|})) (param $s-i31_any (ref null ${ref?|i31|_anyref})) + (func $boo (param $s-i31 (ref null $struct-i31)) (param $s-i31_any (ref null $struct-i31_any)) (local.set $s-i31 (local.get $s-i31_any) ) diff --git a/test/table-import.wast.from-wast b/test/table-import.wast.from-wast index e490d690b..6592dc3f0 100644 --- a/test/table-import.wast.from-wast +++ b/test/table-import.wast.from-wast @@ -1,5 +1,5 @@ (module - (type $none_=>_none (func)) + (type $0 (func)) (import "env" "table" (table $timport$0 1 1 funcref)) (elem (i32.const 0) $foo) (memory $0 0) diff --git a/test/tail-call.wast.from-wast b/test/tail-call.wast.from-wast index 480f47a4f..3c0e0c150 100644 --- a/test/tail-call.wast.from-wast +++ b/test/tail-call.wast.from-wast @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) + (type $void (func)) (table $0 1 1 funcref) (elem (i32.const 0) $foo) (func $foo (return_call $bar) ) (func $bar - (return_call_indirect $0 (type $none_=>_none) + (return_call_indirect $0 (type $void) (i32.const 0) ) ) diff --git a/test/typed-function-references.wast.from-wast b/test/typed-function-references.wast.from-wast index dde689fa0..f96303aa5 100644 --- a/test/typed-function-references.wast.from-wast +++ b/test/typed-function-references.wast.from-wast @@ -1,13 +1,13 @@ (module (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $ref?|i32_->_i32|_=>_i32 (func (param (ref null $i32_=>_i32)) (result i32))) - (type $none_=>_eqref (func (result eqref))) + (type $i32-i32 (func (param i32) (result i32))) + (type $ref?|$i32-i32|_=>_i32 (func (param (ref null $i32-i32)) (result i32))) + (type $=>eqref (func (result eqref))) (type $none_=>_i32 (func (result i32))) - (type $none_=>_anyref (func (result anyref))) - (type $none_=>_i32_ref?|none_->_anyref_f32_anyref_f32|_f64 (func (result i32 (ref null $none_=>_anyref_f32_anyref_f32) f64))) - (type $none_=>_anyref_f32_anyref_f32 (func (result anyref f32 anyref f32))) - (type $f64_=>_ref?|none_->_eqref| (func (param f64) (result (ref null $none_=>_eqref)))) + (type $=>anyref (func (result anyref))) + (type $none_=>_i32_ref?|$mixed_results|_f64 (func (result i32 (ref null $mixed_results) f64))) + (type $mixed_results (func (result anyref f32 anyref f32))) + (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $=>eqref)))) (func $call-ref (call_ref (ref.func $call-ref) @@ -24,20 +24,20 @@ (ref.func $call-ref-more) ) ) - (func $call_from-param (param $f (ref null $i32_=>_i32)) (result i32) + (func $call_from-param (param $f (ref null $i32-i32)) (result i32) (call_ref (i32.const 42) (local.get $f) ) ) - (func $call_from-param-null (param $f (ref null $i32_=>_i32)) (result i32) + (func $call_from-param-null (param $f (ref null $i32-i32)) (result i32) (call_ref (i32.const 42) (local.get $f) ) ) (func $call_from-local-null (result i32) - (local $f (ref null $i32_=>_i32)) + (local $f (ref null $i32-i32)) (local.set $f (ref.func $call-ref-more) ) @@ -46,16 +46,16 @@ (local.get $f) ) ) - (func $ref-in-sig (param $0 f64) (result (ref null $none_=>_eqref)) - (ref.null $none_=>_eqref) + (func $ref-in-sig (param $0 f64) (result (ref null $=>eqref)) + (ref.null $=>eqref) ) (func $type-only-in-tuple-local - (local $x (i32 (ref null $none_=>_anyref) f64)) + (local $x (i32 (ref null $=>anyref) f64)) (nop) ) (func $type-only-in-tuple-block (drop - (block $block (result i32 (ref null $none_=>_anyref_f32_anyref_f32) f64) + (block $block (result i32 (ref null $mixed_results) f64) (unreachable) ) ) |