diff options
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r-- | src/ir/module-utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index 93d110120..368af71a5 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -418,7 +418,7 @@ template<typename T> struct CallGraphPropertyAnalysis { } }; -// Helper function for collecting the type signature used in a module +// Helper function for collecting the type signatures used in a module // // Used when emitting or printing a module to give signatures canonical // indices. Signatures are sorted in order of decreasing frequency to minize the @@ -441,6 +441,12 @@ collectSignatures(Module& wasm, TypeCounter(Counts& counts) : counts(counts) {} void visitCallIndirect(CallIndirect* curr) { counts[curr->sig]++; } + void visitBlock(Block* curr) { + // TODO: Allow blocks to have input types as well + if (curr->type.isMulti()) { + counts[Signature(Type::none, curr->type)]++; + } + } }; TypeCounter(counts).walk(func->body); }; |