summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
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/wasm/wasm.cpp
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/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index f769cb1f5..ea82bac39 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -96,7 +96,7 @@ Name SPECTEST("spectest");
Name PRINT("print");
Name EXIT("exit");
Name SHARED("shared");
-Name EVENT("event");
+Name TAG("tag");
Name ATTR("attr");
// Expressions
@@ -1194,8 +1194,8 @@ Global* Module::getGlobal(Name name) {
return getModuleElement(globalsMap, name, "getGlobal");
}
-Event* Module::getEvent(Name name) {
- return getModuleElement(eventsMap, name, "getEvent");
+Tag* Module::getTag(Name name) {
+ return getModuleElement(tagsMap, name, "getTag");
}
template<typename Map>
@@ -1227,8 +1227,8 @@ Global* Module::getGlobalOrNull(Name name) {
return getModuleElementOrNull(globalsMap, name);
}
-Event* Module::getEventOrNull(Name name) {
- return getModuleElementOrNull(eventsMap, name);
+Tag* Module::getTagOrNull(Name name) {
+ return getModuleElementOrNull(tagsMap, name);
}
// TODO(@warchant): refactor all usages to use variant with unique_ptr
@@ -1275,8 +1275,8 @@ Global* Module::addGlobal(Global* curr) {
return addModuleElement(globals, globalsMap, curr, "addGlobal");
}
-Event* Module::addEvent(Event* curr) {
- return addModuleElement(events, eventsMap, curr, "addEvent");
+Tag* Module::addTag(Tag* curr) {
+ return addModuleElement(tags, tagsMap, curr, "addTag");
}
Export* Module::addExport(std::unique_ptr<Export>&& curr) {
@@ -1302,8 +1302,8 @@ Global* Module::addGlobal(std::unique_ptr<Global>&& curr) {
return addModuleElement(globals, globalsMap, std::move(curr), "addGlobal");
}
-Event* Module::addEvent(std::unique_ptr<Event>&& curr) {
- return addModuleElement(events, eventsMap, std::move(curr), "addEvent");
+Tag* Module::addTag(std::unique_ptr<Tag>&& curr) {
+ return addModuleElement(tags, tagsMap, std::move(curr), "addTag");
}
void Module::addStart(const Name& s) { start = s; }
@@ -1334,9 +1334,7 @@ void Module::removeElementSegment(Name name) {
void Module::removeGlobal(Name name) {
removeModuleElement(globals, globalsMap, name);
}
-void Module::removeEvent(Name name) {
- removeModuleElement(events, eventsMap, name);
-}
+void Module::removeTag(Name name) { removeModuleElement(tags, tagsMap, name); }
template<typename Vector, typename Map, typename Elem>
void removeModuleElements(Vector& v,
@@ -1369,8 +1367,8 @@ void Module::removeElementSegments(std::function<bool(ElementSegment*)> pred) {
void Module::removeGlobals(std::function<bool(Global*)> pred) {
removeModuleElements(globals, globalsMap, pred);
}
-void Module::removeEvents(std::function<bool(Event*)> pred) {
- removeModuleElements(events, eventsMap, pred);
+void Module::removeTags(std::function<bool(Tag*)> pred) {
+ removeModuleElements(tags, tagsMap, pred);
}
void Module::updateMaps() {
@@ -1394,9 +1392,9 @@ void Module::updateMaps() {
for (auto& curr : globals) {
globalsMap[curr->name] = curr.get();
}
- eventsMap.clear();
- for (auto& curr : events) {
- eventsMap[curr->name] = curr.get();
+ tagsMap.clear();
+ for (auto& curr : tags) {
+ tagsMap[curr->name] = curr.get();
}
}