Skip to content

Commit 1c46ee3

Browse files
committed
rustc: Add llalign_of_min
1 parent 43751e4 commit 1c46ee3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rustc/middle/trans/shape.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,12 @@ fn llalign_of_pref(cx: @crate_ctxt, t: TypeRef) -> uint {
637637
ret llvm::LLVMPreferredAlignmentOfType(cx.td.lltd, t) as uint;
638638
}
639639

640+
// Returns the minimum alignment of a type required by the plattform.
641+
// This is the alignment that will be used for struct fields.
642+
fn llalign_of_min(cx: @crate_ctxt, t: TypeRef) -> uint {
643+
ret llvm::LLVMABIAlignmentOfType(cx.td.lltd, t) as uint;
644+
}
645+
640646
fn llsize_of(cx: @crate_ctxt, t: TypeRef) -> ValueRef {
641647
ret llvm::LLVMConstIntCast(lib::llvm::llvm::LLVMSizeOf(t), cx.int_type,
642648
False);

0 commit comments

Comments
 (0)