From 28e88b9f993a2e45662fde0b10920aa22e7b1b7f Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Fri, 18 Jun 2021 14:20:03 -0700 Subject: [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 --- src/ir/module-utils.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/ir/module-utils.h') 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 inline void iterDefinedFunctions(Module& wasm, T visitor) { } } -template inline void iterImportedEvents(Module& wasm, T visitor) { - for (auto& import : wasm.events) { +template inline void iterImportedTags(Module& wasm, T visitor) { + for (auto& import : wasm.tags) { if (import->imported()) { visitor(import.get()); } } } -template inline void iterDefinedEvents(Module& wasm, T visitor) { - for (auto& import : wasm.events) { +template inline void iterDefinedTags(Module& wasm, T visitor) { + for (auto& import : wasm.tags) { if (!import->imported()) { visitor(import.get()); } @@ -299,7 +299,7 @@ template 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) { -- cgit v1.2.3