-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[move] Add CFGIR Ast Visitor. Clean up rough edges of T::Program. #17787
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@tnowacki is attempting to deploy a commit to the Mysten Labs Team on Vercel. A member of the Team first needs to authorize it. |
} | ||
} | ||
|
||
fn visit_module( | ||
fn absint_visit_module( |
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.
Could we eliminate this by using the new visitor?
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.
Oh thats fun. Stuffing all of the absint visitors in a visitor?
self.visit_exp(el); | ||
self.visit_exp(er); | ||
} | ||
Command_::Break(_) | Command_::Continue(_) | Command_::Jump { .. } => (), |
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 wonder if these could report an error somehow.
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.
Sure
if self.visit_constant_custom(module, constant_name, cdef) { | ||
self.pop_warning_filter_scope(); | ||
return; | ||
} |
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.
Do we want to add visit_value
and call that here (plus in visit_exp
)?
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.
Sure, seems helpful in the CFGIR
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.
LGTM modulo a few small questions.
## Description This make the following changes: 1. It moves some custom query information that was being maintained as part of the typing context (and before that, as part of the HLIR context) onto `ProgramInfo` to allow matching operations to query information about the structure of datatypes for any program information. 2. It splits the main `PatternMatrix` definitions (data + code) into `shared/matching.rs`, along with a `MatchContext` trait that the matrix specialization operations are now generic over. 3. It removes the actual match compilation code from typing, partially reverting #17559 -- counterexample generation and IDE suggestion analysis happens in typing as a visitor over function bodies, but matches remain intact through all of typing now. 4. It reinstates the previous code for compiling `match` as part of HLIR lowering. Along the way, this code also cleaned up a bit of how struct and enum information was being indexed in HLIR lowering, opting to reuse the now-stored TypedProgramInfo (🎉 #17787) as opposed to recomputing this information from scratch. ## Test plan All tests should still work as expected with no other changes. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
## Description This make the following changes: 1. It moves some custom query information that was being maintained as part of the typing context (and before that, as part of the HLIR context) onto `ProgramInfo` to allow matching operations to query information about the structure of datatypes for any program information. 2. It splits the main `PatternMatrix` definitions (data + code) into `shared/matching.rs`, along with a `MatchContext` trait that the matrix specialization operations are now generic over. 3. It removes the actual match compilation code from typing, partially reverting MystenLabs#17559 -- counterexample generation and IDE suggestion analysis happens in typing as a visitor over function bodies, but matches remain intact through all of typing now. 4. It reinstates the previous code for compiling `match` as part of HLIR lowering. Along the way, this code also cleaned up a bit of how struct and enum information was being indexed in HLIR lowering, opting to reuse the now-stored TypedProgramInfo (🎉 MystenLabs#17787) as opposed to recomputing this information from scratch. ## Test plan All tests should still work as expected with no other changes. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
Test plan
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.