From 1c46ee34beb7149b8a8b167340acf9fb7a12cd2e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 26 Apr 2012 21:52:55 -0700 Subject: [PATCH] rustc: Add llalign_of_min --- src/rustc/middle/trans/shape.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rustc/middle/trans/shape.rs b/src/rustc/middle/trans/shape.rs index ffd80bcf7da..bc694b3b1e2 100644 --- a/src/rustc/middle/trans/shape.rs +++ b/src/rustc/middle/trans/shape.rs @@ -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);