Compute the space occupied by bases, vptr, etc. based on offset of first field.

This amounts to giving up: rather than enumerating each source of data, we just check the offset of the first field (or end of the array). I did it this way because, best as I can tell, ASTRecordLayout does not export information about vtable pointers except whether one exists or not -- so, for example, it doesn't say how many there are. It's simpler and unifying for several cases to simply write down an opaque thunk. This also unifies the logic with the empty struct / sizeof one case, though really that might be a bad thing, as it prevents us from making the field public.

We do still need to e.g. check that any base classes exist at all, in order to decide whether there must be a private field.

PiperOrigin-RevId: 446904649
17 files changed
tree: 8c33027eeffad9637f7ff7f6017056bc57d04e58
  1. cc_template/
  2. common/
  3. docs/
  4. lifetime_annotations/
  5. migrator/
  6. rs_bindings_from_cc/
  7. BUILD
  8. CODE_OF_CONDUCT
  9. CONTRIBUTING
  10. LICENSE
  11. README.md
README.md

Crubit: C++/Rust Bidirectional Interop Tool

Extremely experimental interop tooling for C++ and Rust.

Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.