Skip to content

Commit 0df4855

Browse files
committed
Rename align to platform_align on Scalar and Primitive
To emphasize that just because you see a `Scalar(I32)` that doesn't really tell you anything about the alignment it has -- one should be looking at the type (well, the place) for that. No actual layout or behaviour changes in *this* PR.
1 parent 9ff44af commit 0df4855

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
10641064
},
10651065
)
10661066
} else if let abi::BackendRepr::ScalarPair(ref a, ref b) = place.layout.backend_repr {
1067-
let b_offset = a.size(self).align_to(b.align(self).abi);
1067+
let b_offset = a.size(self).align_to(b.default_align(self).abi);
10681068

10691069
let mut load = |i, scalar: &abi::Scalar, align| {
10701070
let ptr = if i == 0 {

src/type_of.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
325325
return cx.type_i1();
326326
}
327327

328-
let offset = if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.align(cx).abi) };
328+
let offset =
329+
if index == 0 { Size::ZERO } else { a.size(cx).align_to(b.default_align(cx).abi) };
329330
self.scalar_gcc_type_at(cx, scalar, offset)
330331
}
331332

0 commit comments

Comments
 (0)