Skip to content
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

General Il traversal #22

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

General Il traversal #22

wants to merge 14 commits into from

Conversation

matijapretnar
Copy link

When I started writing my own IL pass, I noticed how much boilerplate there is in the traversal. This tries to resolve the problem by creating a generic function that traverses the whole script, with hooks in the proper places. I will make a PR when I am able to succinctly express all current passes written by @nomeata, but I still wanted to show you where things are heading right now.

@nomeata
Copy link

nomeata commented May 16, 2023

I welcome nice helpers for common cases, although i wondering how often one needs to write a pass that doesn't fit this scheme (local env updates, different accumulators in different surpasses etc.)

Personally I'd probably lean towards simplifying the structure of the AST so that there is less boiler plate code to write (E.g. BinOp and RelOp really don't need to be different at this point).

But this is not to discourage you; if indeed it removes the boiler plate code from most passes then great!

Alan-Liang pushed a commit to Alan-Liang/spectec that referenced this pull request Sep 1, 2024
Merge with WebAssembly/function-references
Alan-Liang pushed a commit to Alan-Liang/spectec that referenced this pull request Sep 2, 2024
A few more typo fixes in Explainer.md
rossberg pushed a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants