rustc: Add llalign_of_min

This commit is contained in:
Brian Anderson 2012-04-26 21:52:55 -07:00
parent 43751e45d9
commit 1c46ee34be

View File

@ -637,6 +637,12 @@ fn llalign_of_pref(cx: @crate_ctxt, t: TypeRef) -> uint {
ret llvm::LLVMPreferredAlignmentOfType(cx.td.lltd, t) as uint;
}
// Returns the minimum alignment of a type required by the plattform.
// This is the alignment that will be used for struct fields.
fn llalign_of_min(cx: @crate_ctxt, t: TypeRef) -> uint {
ret llvm::LLVMABIAlignmentOfType(cx.td.lltd, t) as uint;
}
fn llsize_of(cx: @crate_ctxt, t: TypeRef) -> ValueRef {
ret llvm::LLVMConstIntCast(lib::llvm::llvm::LLVMSizeOf(t), cx.int_type,
False);