-
Notifications
You must be signed in to change notification settings - Fork 833
[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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,18 +220,15 @@ Result<> IRBuilder::visitExpression(Expression* curr) { | |
| #define DELEGATE_FIELD_CHILD_VECTOR(id, field) \ | ||
| WASM_UNREACHABLE("should have called visit" #id " because " #id \ | ||
| " has child vector " #field); | ||
| #define DELEGATE_FIELD_SCOPE_NAME_USE(id, field) \ | ||
| WASM_UNREACHABLE("should have called visit" #id " because " #id \ | ||
| " has scope name use " #field); | ||
| #define DELEGATE_FIELD_SCOPE_NAME_USE_VECTOR(id, field) \ | ||
| WASM_UNREACHABLE("should have called visit" #id " because " #id \ | ||
| " has scope name use vector " #field); | ||
|
|
||
| #define DELEGATE_FIELD_INT(id, field) | ||
| #define DELEGATE_FIELD_INT_ARRAY(id, field) | ||
| #define DELEGATE_FIELD_LITERAL(id, field) | ||
| #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) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the vector version do that's different?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm removing the error when visiting |
||
|
|
||
| #define DELEGATE_FIELD_TYPE(id, field) | ||
| #define DELEGATE_FIELD_HEAPTYPE(id, field) | ||
| #define DELEGATE_FIELD_ADDRESS(id, field) | ||
|
|
@@ -933,7 +930,14 @@ Result<> IRBuilder::makeRefCast(Type type) { | |
| return Ok{}; | ||
| } | ||
|
|
||
| // Result<> IRBuilder::makeBrOn() {} | ||
| Result<> IRBuilder::makeBrOn(Index label, BrOnOp op, Type castType) { | ||
| BrOn curr; | ||
| CHECK_ERR(visitBrOn(&curr)); | ||
| auto name = getLabelName(label); | ||
| CHECK_ERR(name); | ||
| push(builder.makeBrOn(op, *name, curr.ref, castType)); | ||
| return Ok{}; | ||
| } | ||
|
|
||
| Result<> IRBuilder::makeStructNew(HeapType type) { | ||
| StructNew curr(wasm.allocator); | ||
|
|
||
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