Skip to content

Pass Crubit's IR directly in shared memory instead of via Protobuf. - #2529

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1004330994
Oct 30, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1004330994

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Pass Crubit's IR directly in shared memory instead of via Protobuf.

Previously, rs_bindings_from_cc translated Clang AST nodes through three separate representations: C++ importers populated handwritten C++ structs, serialized them into Protobuf messages across FFI, and proto_to_ir validated and copied them again into 'pb-parameterized Rust wrapper types. That pipeline duplicated every IR definition across three layers, paid serialization and allocation costs on every target, and threaded 'pb lifetimes throughout Salsa queries and code generation.

Constructing and consuming the generated #[repr(C)] IR types directly in C++ and Rust collapses those redundant intermediate layers into a single shared-memory representation, eliminates FFI serialization, and replaces 'pb borrows with reference-counted item handles that clone cheaply across Salsa queries. Now-unused .proto definitions and legacy FFI shims are left untouched here so their bulk deletion can be reviewed separately from behavioral changes.

@copybara-service
copybara-service Bot force-pushed the test_1004330994 branch 3 times, most recently from 2b73a65 to 195679f Compare October 29, 2026 05:27
@copybara-service copybara-service Bot changed the title Cut over C++ importers, Rust IR, and FFI boundary to ad-hoc FFI IR. Pass Crubit's IR directly in shared memory instead of via Protobuf. Oct 29, 2026
@copybara-service
copybara-service Bot force-pushed the test_1004330994 branch 7 times, most recently from 9e5bf88 to aac9b6e Compare October 30, 2026 00:13
Previously, `rs_bindings_from_cc` translated Clang AST nodes through three separate representations: C++ importers populated handwritten C++ structs, serialized them into Protobuf messages across FFI, and `proto_to_ir` validated and copied them again into `'pb`-parameterized Rust wrapper types. That pipeline duplicated every IR definition across three layers, paid serialization and allocation costs on every target, and threaded `'pb` lifetimes throughout Salsa queries and code generation.

Constructing and consuming the generated `#[repr(C)]` IR types directly in C++ and Rust collapses those redundant intermediate layers into a single shared-memory representation, eliminates FFI serialization, and replaces `'pb` borrows with reference-counted item handles that clone cheaply across Salsa queries. Now-unused `.proto` definitions and legacy FFI shims are left untouched here so their bulk deletion can be reviewed separately from behavioral changes.

PiperOrigin-RevId: 1010088592
@copybara-service
copybara-service Bot merged commit 332d783 into main Oct 30, 2026
2 checks passed
@copybara-service
copybara-service Bot deleted the test_1004330994 branch October 30, 2026 00:23

This branch was successfully deployed

1 active deployment
github-pages — 332d7834 Deployed Oct 30, 2026 by copybara-service[bot] via deploy #2175
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.

1 participant