| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughIntroduces a Blocks newtype wrapping Vec<Block> in ir.rs, with BlockIdx-aware Index/IndexMut and standard conversion traits. CodeInfo.blocks is changed from Vec<Block> to Blocks, and every CFG construction, optimization, analysis, and transformation function that previously accepted &mut [Block] or &mut Vec<Block> is updated to accept &mut Blocks. All initialization and append sites in compile.rs are updated accordingly, as are unit tests. ChangesBlocks Newtype Refactor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches 🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
crates/codegen/src/ir.rs (1)🤖 Prompt for all review comments with AI agents757-808: 🧹 Nitpick | 🔵 Trivial | 💤 Low value
Consider consistent indexing style.
This function uses blocks[block_idx.idx()] (usize indexing via .idx()) throughout, while other functions like basicblock_append_block_instructions use blocks[block_idx] directly. Both patterns work correctly due to the dual Index implementations, but consistent use of direct BlockIdx indexing would be cleaner and leverage the newtype's purpose.
Not blocking since both patterns are functionally correct.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/codegen/src/ir.rs` around lines 757 - 808, The function cfg_to_instruction_sequence uses inconsistent indexing style by calling .idx() on BlockIdx values (like blocks[block_idx.idx()]) while other functions use direct indexing with the BlockIdx newtype (like blocks[block_idx]). Replace all instances of blocks[block_idx.idx()], blocks[target_block.idx()], and blocks[handler.handler_block.idx()] throughout the function to use direct BlockIdx indexing without calling .idx(), such as blocks[block_idx], blocks[target_block], and blocks[handler.handler_block], to maintain consistency with the codebase and properly leverage the BlockIdx newtype's Index trait implementation.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In `@crates/codegen/src/ir.rs`: - Around line 757-808: The function cfg_to_instruction_sequence uses inconsistent indexing style by calling .idx() on BlockIdx values (like blocks[block_idx.idx()]) while other functions use direct indexing with the BlockIdx newtype (like blocks[block_idx]). Replace all instances of blocks[block_idx.idx()], blocks[target_block.idx()], and blocks[handler.handler_block.idx()] throughout the function to use direct BlockIdx indexing without calling .idx(), such as blocks[block_idx], blocks[target_block], and blocks[handler.handler_block], to maintain consistency with the codebase and properly leverage the BlockIdx newtype's Index trait implementation.
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 06947e9b-5ad8-4d27-9ce6-c20a4f72b915
📥 CommitsReviewing files that changed from the base of the PR and between 55b96f9 and e476f3c.
📒 Files selected for processing (2)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Summary by CodeRabbit