summaryrefslogtreecommitdiff
path: root/src/passes/SignaturePruning.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/SignaturePruning.cpp')
-rw-r--r--src/passes/SignaturePruning.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/passes/SignaturePruning.cpp b/src/passes/SignaturePruning.cpp
index 292feeca5..cd3f4abf6 100644
--- a/src/passes/SignaturePruning.cpp
+++ b/src/passes/SignaturePruning.cpp
@@ -35,6 +35,7 @@
#include "ir/type-updating.h"
#include "param-utils.h"
#include "pass.h"
+#include "support/insert_ordered.h"
#include "support/sorted_vector.h"
#include "wasm-type.h"
#include "wasm.h"
@@ -98,10 +99,14 @@ struct SignaturePruning : public Pass {
std::unordered_map<HeapType, Info> allInfo;
// Map heap types to all functions with that type.
- std::unordered_map<HeapType, std::vector<Function*>> sigFuncs;
+ InsertOrderedMap<HeapType, std::vector<Function*>> sigFuncs;
+
+ // Combine all the information we gathered into that map, iterating in a
+ // deterministic order as we build up vectors where the order matters.
+ for (auto& f : module->functions) {
+ auto* func = f.get();
+ auto& info = analysis.map[func];
- // Combine all the information we gathered into that map.
- for (auto& [func, info] : analysis.map) {
// For direct calls, add each call to the type of the function being
// called.
for (auto* call : info.calls) {