summaryrefslogtreecommitdiff
path: root/src/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir')
-rw-r--r--src/ir/ExpressionManipulator.cpp2
-rw-r--r--src/ir/ReFinalize.cpp2
-rw-r--r--src/ir/branch-utils.h2
-rw-r--r--src/ir/module-utils.h61
-rw-r--r--src/ir/type-updating.h2
5 files changed, 21 insertions, 48 deletions
diff --git a/src/ir/ExpressionManipulator.cpp b/src/ir/ExpressionManipulator.cpp
index fdefbb2e0..2542e5743 100644
--- a/src/ir/ExpressionManipulator.cpp
+++ b/src/ir/ExpressionManipulator.cpp
@@ -242,7 +242,7 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
}
Expression* visitBrOnExn(BrOnExn* curr) {
return builder.makeBrOnExn(
- curr->name, curr->event, copy(curr->exnref), curr->eventParams);
+ curr->name, curr->event, copy(curr->exnref), curr->sent);
}
Expression* visitNop(Nop* curr) { return builder.makeNop(); }
Expression* visitUnreachable(Unreachable* curr) {
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp
index 9ee109f5e..007a7ee55 100644
--- a/src/ir/ReFinalize.cpp
+++ b/src/ir/ReFinalize.cpp
@@ -164,7 +164,7 @@ void ReFinalize::visitThrow(Throw* curr) { curr->finalize(); }
void ReFinalize::visitRethrow(Rethrow* curr) { curr->finalize(); }
void ReFinalize::visitBrOnExn(BrOnExn* curr) {
curr->finalize();
- updateBreakValueType(curr->name, curr->getSingleSentType());
+ updateBreakValueType(curr->name, curr->sent);
}
void ReFinalize::visitNop(Nop* curr) { curr->finalize(); }
void ReFinalize::visitUnreachable(Unreachable* curr) { curr->finalize(); }
diff --git a/src/ir/branch-utils.h b/src/ir/branch-utils.h
index 976dd72ec..c4ff26c0c 100644
--- a/src/ir/branch-utils.h
+++ b/src/ir/branch-utils.h
@@ -221,7 +221,7 @@ struct BranchSeeker : public PostWalker<BranchSeeker> {
}
// check the br_on_exn
if (curr->name == target) {
- noteFound(curr->getSingleSentType());
+ noteFound(curr->sent);
}
}
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h
index 52765035c..0fd478551 100644
--- a/src/ir/module-utils.h
+++ b/src/ir/module-utils.h
@@ -38,51 +38,25 @@ struct BinaryIndexes {
std::unordered_map<Name, Index> eventIndexes;
BinaryIndexes(Module& wasm) {
- auto addGlobal = [&](Global* curr) {
- auto index = globalIndexes.size();
- globalIndexes[curr->name] = index;
- };
- for (auto& curr : wasm.globals) {
- if (curr->imported()) {
- addGlobal(curr.get());
- }
- }
- for (auto& curr : wasm.globals) {
- if (!curr->imported()) {
- addGlobal(curr.get());
- }
- }
- assert(globalIndexes.size() == wasm.globals.size());
- auto addFunction = [&](Function* curr) {
- auto index = functionIndexes.size();
- functionIndexes[curr->name] = index;
- };
- for (auto& curr : wasm.functions) {
- if (curr->imported()) {
- addFunction(curr.get());
+ auto addIndexes = [&](auto& source, auto& indexes) {
+ auto addIndex = [&](auto* curr) {
+ auto index = indexes.size();
+ indexes[curr->name] = index;
+ };
+ for (auto& curr : source) {
+ if (curr->imported()) {
+ addIndex(curr.get());
+ }
}
- }
- for (auto& curr : wasm.functions) {
- if (!curr->imported()) {
- addFunction(curr.get());
+ for (auto& curr : source) {
+ if (!curr->imported()) {
+ addIndex(curr.get());
+ }
}
- }
- assert(functionIndexes.size() == wasm.functions.size());
- auto addEvent = [&](Event* curr) {
- auto index = eventIndexes.size();
- eventIndexes[curr->name] = index;
};
- for (auto& curr : wasm.events) {
- if (curr->imported()) {
- addEvent(curr.get());
- }
- }
- for (auto& curr : wasm.events) {
- if (!curr->imported()) {
- addEvent(curr.get());
- }
- }
- assert(eventIndexes.size() == wasm.events.size());
+ addIndexes(wasm.functions, functionIndexes);
+ addIndexes(wasm.globals, globalIndexes);
+ addIndexes(wasm.events, eventIndexes);
}
};
@@ -126,8 +100,7 @@ inline Event* copyEvent(Event* event, Module& out) {
auto* ret = new Event();
ret->name = event->name;
ret->attribute = event->attribute;
- ret->type = event->type;
- ret->params = event->params;
+ ret->sig = event->sig;
out.addEvent(ret);
return ret;
}
diff --git a/src/ir/type-updating.h b/src/ir/type-updating.h
index 1fa891ec1..d64ae0158 100644
--- a/src/ir/type-updating.h
+++ b/src/ir/type-updating.h
@@ -154,7 +154,7 @@ struct TypeUpdater
} else if (auto* sw = curr->dynCast<Switch>()) {
applySwitchChanges(sw, change);
} else if (auto* br = curr->dynCast<BrOnExn>()) {
- noteBreakChange(br->name, change, br->getSingleSentType());
+ noteBreakChange(br->name, change, br->sent);
}
}