Skip to content

Implement Rust-side reconstruction of the nested IR to FlatIR.#1235

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_933733681
Open

Implement Rust-side reconstruction of the nested IR to FlatIR.#1235
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_933733681

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 17, 2026

Copy link
Copy Markdown

Implement Rust-side reconstruction of the nested IR to FlatIR.

This change does not yet modify consumers in generate_bindings to use the realized children's items. Rather we derive the children_item_ids from the items passed by the frontend (if the nested_IR flag is enabled) to be consistent with the flat IR branch.

Specifically, this change:

  • Implements make_ir_from_tree in ir.rs to reconstruct the declaration tree on the Rust side from top_level_items, and populate a lookup cache of itemId to items.
  • Ensures nested items are discoverable: db::find_untyped_decl looks up items in the reconstructed tree cache instead of flat_ir.items.
  • Propagates changes to IR structure and db to the relevant bindings generation logic ie. generate_struct_and_union.rs

@google-cla

google-cla Bot commented Jun 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service Bot changed the title Implement Rust-side reconstruction of IRProto to FlatIR, and then IR. Implement Rust-side reconstruction of the nested IR to FlatIR. Jun 17, 2026
@copybara-service copybara-service Bot force-pushed the test_933733681 branch 3 times, most recently from ddfd648 to be40694 Compare June 18, 2026 06:10
This change does not yet modify consumers in generate_bindings to use the realized children's items. Rather we derive the children_item_ids from the items passed by the frontend (if the nested_IR flag is enabled) to be consistent with the flat IR branch.

Specifically, this change:
- Implements `make_ir_from_tree` in `ir.rs` to reconstruct the declaration tree on the Rust side from `top_level_items`, and populate a lookup cache of itemId to items.
- Ensures nested items are discoverable: `db::find_untyped_decl` looks up items in the reconstructed tree cache instead of `flat_ir.items`.
- Propagates changes to IR structure and db to the relevant bindings generation logic ie. `generate_struct_and_union.rs`

PiperOrigin-RevId: 933733681
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.

0 participants