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/import-utils.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/ir/import-utils.h') diff --git a/src/ir/import-utils.h b/src/ir/import-utils.h index e4a656379..2e7a4f44c 100644 --- a/src/ir/import-utils.h +++ b/src/ir/import-utils.h @@ -30,7 +30,7 @@ struct ImportInfo { std::vector importedGlobals; std::vector importedFunctions; std::vector importedTables; - std::vector importedEvents; + std::vector importedTags; ImportInfo(Module& wasm) : wasm(wasm) { for (auto& import : wasm.globals) { @@ -48,9 +48,9 @@ struct ImportInfo { importedTables.push_back(import.get()); } } - for (auto& import : wasm.events) { + for (auto& import : wasm.tags) { if (import->imported()) { - importedEvents.push_back(import.get()); + importedTags.push_back(import.get()); } } } @@ -73,8 +73,8 @@ struct ImportInfo { return nullptr; } - Event* getImportedEvent(Name module, Name base) { - for (auto* import : importedEvents) { + Tag* getImportedTag(Name module, Name base) { + for (auto* import : importedTags) { if (import->module == module && import->base == base) { return import; } @@ -88,11 +88,11 @@ struct ImportInfo { Index getNumImportedTables() { return importedTables.size(); } - Index getNumImportedEvents() { return importedEvents.size(); } + Index getNumImportedTags() { return importedTags.size(); } Index getNumImports() { return getNumImportedGlobals() + getNumImportedFunctions() + - getNumImportedEvents() + (wasm.memory.imported() ? 1 : 0) + + getNumImportedTags() + (wasm.memory.imported() ? 1 : 0) + getNumImportedTables(); } @@ -108,9 +108,7 @@ struct ImportInfo { return wasm.tables.size() - getNumImportedTables(); } - Index getNumDefinedEvents() { - return wasm.events.size() - getNumImportedEvents(); - } + Index getNumDefinedTags() { return wasm.tags.size() - getNumImportedTags(); } }; } // namespace wasm -- cgit v1.2.3