Repository navigation
Pass Crubit's IR directly in shared memory instead of via Protobuf. - #2529
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1004330994
branch
3 times, most recently
from
October 29, 2026 05:27
2b73a65 to
195679f
Compare
copybara-service
Bot
force-pushed
the
test_1004330994
branch
7 times, most recently
from
October 30, 2026 00:13
9e5bf88 to
aac9b6e
Compare
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
Bot
force-pushed
the
test_1004330994
branch
from
October 30, 2026 00:23
aac9b6e to
332d783
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass Crubit's IR directly in shared memory instead of via Protobuf.
Previously,
rs_bindings_from_cctranslated Clang AST nodes through three separate representations: C++ importers populated handwritten C++ structs, serialized them into Protobuf messages across FFI, andproto_to_irvalidated 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'pblifetimes 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'pbborrows with reference-counted item handles that clone cheaply across Salsa queries. Now-unused.protodefinitions and legacy FFI shims are left untouched here so their bulk deletion can be reviewed separately from behavioral changes.