You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we compute a struct's padding fields while we are codegen'ing it.
Instead, we should have a dedicated phase for computing implicit padding fields that transforms from structs-with-only-explicit-fields to structs-with-explicit-fields-and-implicit-padding-fields.
This new phase should probably happen either right before or right after we compute allocation units for bitfields. I'm not 100% sure which, and determining it requires further investigation/experimentation.
The text was updated successfully, but these errors were encountered:
Right now, we compute a struct's padding fields while we are codegen'ing it.
Instead, we should have a dedicated phase for computing implicit padding fields that transforms from structs-with-only-explicit-fields to structs-with-explicit-fields-and-implicit-padding-fields.
Benefits this will give us:
The ability to precisely derive various traits for structs with large alignment (right now we are conservatively pessimistic). See for example https://github.com/rust-lang-nursery/rust-bindgen/blob/b13f0766e28cf75dd04f358bf64d87ea96b111c3/src/ir/analysis/derive_debug.rs#L160-L170
Separation of concerns, simpler code
This new phase should probably happen either right before or right after we compute allocation units for bitfields. I'm not 100% sure which, and determining it requires further investigation/experimentation.
The text was updated successfully, but these errors were encountered: