Skip to content

Stop walking all of AST on every pass #1204

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

Closed
marijnh opened this issue Nov 21, 2011 · 2 comments
Closed

Stop walking all of AST on every pass #1204

marijnh opened this issue Nov 21, 2011 · 2 comments

Comments

@marijnh
Copy link
Contributor

marijnh commented Nov 21, 2011

Most passes aren't interested in, for example, types, yet the default visitor runs through all type nodes on every walk anyway.

We could provide several variants of default_visitor(), which descend into different subsets of the AST, and make sure each pass uses the right variant.

@ghost ghost assigned marijnh Nov 21, 2011
@boggle
Copy link
Contributor

boggle commented Nov 21, 2011

Nice, this should speed things up. How are you doing it? I see a bitv that describes which passes the visitor should enter.

@marijnh
Copy link
Contributor Author

marijnh commented Nov 21, 2011

There's no bitv. A pass has function values for entering each kind of node. You can pass no-op functions for nodes that don't contain anything interesting.

@marijnh marijnh removed their assignment Jun 16, 2014
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 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

No branches or pull requests

2 participants