summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-06-18 14:20:03 -0700
committerGitHub <noreply@github.com>2021-06-18 14:20:03 -0700
commit28e88b9f993a2e45662fde0b10920aa22e7b1b7f (patch)
tree77bbd5f1dd1bfcb089b12f6fa9fcf828c135c099 /src/ir/module-utils.h
parent97e277c51218778d1d76fd59fed3b4ca7756382e (diff)
downloadbinaryen-28e88b9f993a2e45662fde0b10920aa22e7b1b7f.tar.gz
binaryen-28e88b9f993a2e45662fde0b10920aa22e7b1b7f.tar.bz2
binaryen-28e88b9f993a2e45662fde0b10920aa22e7b1b7f.zip
[EH] Replace event with tag (#3937)
We recently decided to change 'event' to 'tag', and to 'event section' to 'tag section', out of the rationale that the section contains a generalized tag that references a type, which may be used for something other than exceptions, and the name 'event' can be confusing in the web context. See - https://github.com/WebAssembly/exception-handling/issues/159#issuecomment-857910130 - https://github.com/WebAssembly/exception-handling/pull/161
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r--src/ir/module-utils.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h
index aaf484036..c93b24293 100644
--- a/src/ir/module-utils.h
+++ b/src/ir/module-utils.h
@@ -63,12 +63,12 @@ inline Global* copyGlobal(Global* global, Module& out) {
return ret;
}
-inline Event* copyEvent(Event* event, Module& out) {
- auto* ret = new Event();
- ret->name = event->name;
- ret->attribute = event->attribute;
- ret->sig = event->sig;
- out.addEvent(ret);
+inline Tag* copyTag(Tag* tag, Module& out) {
+ auto* ret = new Tag();
+ ret->name = tag->name;
+ ret->attribute = tag->attribute;
+ ret->sig = tag->sig;
+ out.addTag(ret);
return ret;
}
@@ -120,8 +120,8 @@ inline void copyModule(const Module& in, Module& out) {
for (auto& curr : in.globals) {
copyGlobal(curr.get(), out);
}
- for (auto& curr : in.events) {
- copyEvent(curr.get(), out);
+ for (auto& curr : in.tags) {
+ copyTag(curr.get(), out);
}
for (auto& curr : in.elementSegments) {
copyElementSegment(curr.get(), out);
@@ -278,16 +278,16 @@ template<typename T> inline void iterDefinedFunctions(Module& wasm, T visitor) {
}
}
-template<typename T> inline void iterImportedEvents(Module& wasm, T visitor) {
- for (auto& import : wasm.events) {
+template<typename T> inline void iterImportedTags(Module& wasm, T visitor) {
+ for (auto& import : wasm.tags) {
if (import->imported()) {
visitor(import.get());
}
}
}
-template<typename T> inline void iterDefinedEvents(Module& wasm, T visitor) {
- for (auto& import : wasm.events) {
+template<typename T> inline void iterDefinedTags(Module& wasm, T visitor) {
+ for (auto& import : wasm.tags) {
if (!import->imported()) {
visitor(import.get());
}
@@ -299,7 +299,7 @@ template<typename T> inline void iterImports(Module& wasm, T visitor) {
iterImportedTables(wasm, visitor);
iterImportedGlobals(wasm, visitor);
iterImportedFunctions(wasm, visitor);
- iterImportedEvents(wasm, visitor);
+ iterImportedTags(wasm, visitor);
}
// Helper class for performing an operation on all the functions in the module,
@@ -514,7 +514,7 @@ inline void collectHeapTypes(Module& wasm,
// Collect module-level info.
Counts counts;
CodeScanner(counts).walkModuleCode(&wasm);
- for (auto& curr : wasm.events) {
+ for (auto& curr : wasm.tags) {
counts.note(curr->sig);
}
for (auto& curr : wasm.tables) {