]> git.lizzy.rs Git - rust.git/commitdiff
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)
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.

1  2 
src/librustc/ty/mod.rs
src/librustc_trans/abi.rs

Simple merge
Simple merge