-
Notifications
You must be signed in to change notification settings - Fork 832
[Parser] Parse BrOn expressions #6100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
| #define DELEGATE_FIELD_NAME(id, field) | ||
| #define DELEGATE_FIELD_NAME_VECTOR(id, field) | ||
| #define DELEGATE_FIELD_SCOPE_NAME_USE(id, field) | ||
| #define DELEGATE_FIELD_SCOPE_NAME_USE_VECTOR(id, field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the vector version do that's different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
br_table is the only instruction that takes a list of labels, so it is the only one that currently uses NAME_USE_VECTOR.
I'm removing the error when visiting NAME_USE because it turns out the default visitExpression implementation Just Works for BrOn, even though it includes NAME_USE. I'm making the same change for NAME_USE_VECTOR for consistency. There's nothing about having a NAME_USE_VECTOR that fundamentally means that this default implementation won't work.
| return ctx.makeRefCast(pos, *type); | ||
| } | ||
|
|
||
| template<typename Ctx> Result<> makeBrOnNull(Ctx& ctx, Index pos, bool onFail) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing where the Contexts are created and how they are passed into the "make" series of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contexts are created and passed to the top-level parse function here: https://github.com/WebAssembly/binaryen/blob/main/src/parser/wat-parser.cpp#L96-L169
e12d33b to
c08afb6
Compare
c08c342 to
199b253
Compare
c08afb6 to
3d800b7
Compare
199b253 to
89cf6b3
Compare

No description provided.