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/wasm-builder.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/wasm-builder.h') diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 79f3ec8df..ca3fed286 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -125,13 +125,13 @@ public: return glob; } - static std::unique_ptr - makeEvent(Name name, uint32_t attribute, Signature sig) { - auto event = std::make_unique(); - event->name = name; - event->attribute = attribute; - event->sig = sig; - return event; + static std::unique_ptr + makeTag(Name name, uint32_t attribute, Signature sig) { + auto tag = std::make_unique(); + tag->name = name; + tag->attribute = attribute; + tag->sig = sig; + return tag; } // IR nodes @@ -647,7 +647,7 @@ public: private: Try* makeTry(Name name, Expression* body, - const std::vector& catchEvents, + const std::vector& catchTags, const std::vector& catchBodies, Name delegateTarget, Type type, @@ -655,7 +655,7 @@ private: auto* ret = wasm.allocator.alloc(); ret->name = name; ret->body = body; - ret->catchEvents.set(catchEvents); + ret->catchTags.set(catchTags); ret->catchBodies.set(catchBodies); if (hasType) { ret->finalize(type); @@ -667,30 +667,30 @@ private: public: Try* makeTry(Expression* body, - const std::vector& catchEvents, + const std::vector& catchTags, const std::vector& catchBodies) { return makeTry( - Name(), body, catchEvents, catchBodies, Name(), Type::none, false); + Name(), body, catchTags, catchBodies, Name(), Type::none, false); } Try* makeTry(Expression* body, - const std::vector& catchEvents, + const std::vector& catchTags, const std::vector& catchBodies, Type type) { - return makeTry(Name(), body, catchEvents, catchBodies, Name(), type, true); + return makeTry(Name(), body, catchTags, catchBodies, Name(), type, true); } Try* makeTry(Name name, Expression* body, - const std::vector& catchEvents, + const std::vector& catchTags, const std::vector& catchBodies) { return makeTry( - name, body, catchEvents, catchBodies, Name(), Type::none, false); + name, body, catchTags, catchBodies, Name(), Type::none, false); } Try* makeTry(Name name, Expression* body, - const std::vector& catchEvents, + const std::vector& catchTags, const std::vector& catchBodies, Type type) { - return makeTry(name, body, catchEvents, catchBodies, Name(), type, true); + return makeTry(name, body, catchTags, catchBodies, Name(), type, true); } Try* makeTry(Expression* body, Name delegateTarget) { return makeTry(Name(), body, {}, {}, delegateTarget, Type::none, false); @@ -704,12 +704,12 @@ public: Try* makeTry(Name name, Expression* body, Name delegateTarget, Type type) { return makeTry(name, body, {}, {}, delegateTarget, type, true); } - Throw* makeThrow(Event* event, const std::vector& args) { - return makeThrow(event->name, args); + Throw* makeThrow(Tag* tag, const std::vector& args) { + return makeThrow(tag->name, args); } - Throw* makeThrow(Name event, const std::vector& args) { + Throw* makeThrow(Name tag, const std::vector& args) { auto* ret = wasm.allocator.alloc(); - ret->event = event; + ret->tag = tag; ret->operands.set(args); ret->finalize(); return ret; -- cgit v1.2.3