]> git.lizzy.rs Git - rust.git/commit
Auto merge of #39999 - bitshifter:struct_align, r=eddyb
authorbors <bors@rust-lang.org>
Sat, 22 Apr 2017 11:50:40 +0000 (11:50 +0000)
committerbors <bors@rust-lang.org>
Sat, 22 Apr 2017 11:50:40 +0000 (11:50 +0000)
commit6d841da4a0d7629f826117f99052e3d4a7997a7e
tree27e04604a86c867e8146bf75ff0c1ea973aaf47c
parentff13b7c91813eb178c98a7abc661acaf5c41dc31
parent946f8e6a59242a8112c6983d1336fef54bc55b9a
Auto merge of #39999 - bitshifter:struct_align, r=eddyb

Implementation of repr struct alignment RFC 1358.

The main changes around rustc::ty::Layout::struct:
* Added abi_align field which stores abi alignment before repr align is applied
* align field contains transitive repr alignment
* Added padding vec which stores padding required after fields

The main user of this information is rustc_trans::adt::struct_llfields
which determines the LLVM fields to be used by LLVM, including padding
fields.

A possible future optimisation would be to put the padding Vec in an Option, since it will be unused unless you are using repr align.
src/librustc/ty/mod.rs
src/librustc_trans/abi.rs