diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-06-18 14:20:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 14:20:03 -0700 |
commit | 28e88b9f993a2e45662fde0b10920aa22e7b1b7f (patch) | |
tree | 77bbd5f1dd1bfcb089b12f6fa9fcf828c135c099 /src/wasm-builder.h | |
parent | 97e277c51218778d1d76fd59fed3b4ca7756382e (diff) | |
download | binaryen-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-builder.h')
-rw-r--r-- | src/wasm-builder.h | 42 |
1 files changed, 21 insertions, 21 deletions
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<Event> - makeEvent(Name name, uint32_t attribute, Signature sig) { - auto event = std::make_unique<Event>(); - event->name = name; - event->attribute = attribute; - event->sig = sig; - return event; + static std::unique_ptr<Tag> + makeTag(Name name, uint32_t attribute, Signature sig) { + auto tag = std::make_unique<Tag>(); + 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<Name>& catchEvents, + const std::vector<Name>& catchTags, const std::vector<Expression*>& catchBodies, Name delegateTarget, Type type, @@ -655,7 +655,7 @@ private: auto* ret = wasm.allocator.alloc<Try>(); 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<Name>& catchEvents, + const std::vector<Name>& catchTags, const std::vector<Expression*>& 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<Name>& catchEvents, + const std::vector<Name>& catchTags, const std::vector<Expression*>& 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<Name>& catchEvents, + const std::vector<Name>& catchTags, const std::vector<Expression*>& 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<Name>& catchEvents, + const std::vector<Name>& catchTags, const std::vector<Expression*>& 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<Expression*>& args) { - return makeThrow(event->name, args); + Throw* makeThrow(Tag* tag, const std::vector<Expression*>& args) { + return makeThrow(tag->name, args); } - Throw* makeThrow(Name event, const std::vector<Expression*>& args) { + Throw* makeThrow(Name tag, const std::vector<Expression*>& args) { auto* ret = wasm.allocator.alloc<Throw>(); - ret->event = event; + ret->tag = tag; ret->operands.set(args); ret->finalize(); return ret; |