-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor assignment statement handling and the typing mechanism around it #40
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
…ch are helper args
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.
Pull Request Overview
This pull request refactors assignment statement handling and the typing mechanism around it. The changes introduce a new assignment pass module and improve binary operations, helper function handling, and type normalization. It also adds support for temporary scratch variables for helper function arguments and enhances the overall assignment handling architecture.
- Introduces dedicated assignment pass module for cleaner code organization
- Adds scratch pool management for temporary variables used in helper functions
- Enhances binary operations to support complex expressions as operands
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/passing_tests/assign/struct_and_helper_binops.py | New test file for struct and helper binary operations |
| tests/passing_tests/assign/helper.py | New test file for helper function assignments |
| tests/passing_tests/assign/cst_var_binop.py | New test file for constant variable binary operations |
| tests/passing_tests/assign/comprehensive.py | New comprehensive test combining struct, helper, and map features |
| tests/failing_tests/assign/retype.py | New test file for variable retyping scenarios |
| pythonbpf/helper/helper_utils.py | Enhanced with scratch pool management and improved argument handling |
| pythonbpf/helper/bpf_helper_handler.py | Updated helper handlers to support new argument system |
| pythonbpf/helper/init.py | Added exports for scratch pool functionality |
| pythonbpf/functions/functions_pass.py | Refactored assignment handling and memory allocation |
| pythonbpf/expr/type_normalization.py | Made helper functions public for reuse |
| pythonbpf/expr/expr_pass.py | Enhanced unary operations and binary operation handling |
| pythonbpf/expr/init.py | Added exports for type normalization functions |
| pythonbpf/binary_ops.py | Improved operand value extraction and type handling |
| pythonbpf/assign_pass.py | New module for dedicated assignment handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
pythonbpf/allocation_pass.py:1
- [nitpick] The nested function
update_max_temps_for_stmtcould be extracted as a module-level function to improve testability and reduce complexity of theallocate_memfunction.
import ast
pythonbpf/helper/helper_utils.py:1
- This TODO comment should include a GitHub issue reference or timeline for when this temporary solution will be addressed to ensure it doesn't become permanent technical debt.
import ast
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.