Implementation of repr struct alignment RFC 1358.
The main changes around rustc::ty::Layout::struct and rustc_trans:adt: * Added primitive_align field which stores alignment before repr align * Always emit field padding when generating the LLVM struct fields * Added methods for adjusting field indexes from the layout index to the LLVM struct field index 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.
This commit is contained in:
parent
ddc5d7bd4b
commit
4358e35fda
26 changed files with 647 additions and 79 deletions
|
@ -773,7 +773,7 @@ fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &
|
|||
for a in type_attrs {
|
||||
for r in &attr::find_repr_attrs(diagnostic, a) {
|
||||
repr_type_name = match *r {
|
||||
attr::ReprPacked | attr::ReprSimd => continue,
|
||||
attr::ReprPacked | attr::ReprSimd | attr::ReprAlign(_) => continue,
|
||||
attr::ReprExtern => "i32",
|
||||
|
||||
attr::ReprInt(attr::SignedInt(ast::IntTy::Is)) => "isize",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue