rustc: Remove old align_of intrinsic

This commit is contained in:
Brian Anderson 2012-04-27 15:40:40 -07:00
parent e85fc9bf00
commit 0be41ce02b
4 changed files with 6 additions and 13 deletions
src
libcore
rustc/middle

View File

@ -26,7 +26,8 @@ native mod rustrt {
native mod rusti {
fn get_tydesc<T>() -> *();
fn size_of<T>() -> uint;
fn align_of<T>() -> uint;
fn pref_align_of<T>() -> uint;
fn min_align_of<T>() -> uint;
}
#[doc = "
@ -51,15 +52,12 @@ This is the alignment used for struct fields. It may be smaller
than the preferred alignment.
"]
fn min_align_of<T>() -> uint unsafe {
// FIXME: use rusti::min_align_of after snapshot
// rusti::align_of::<T>()
fail "FIXME: uncomment the above line to use min_align_of";
rusti::min_align_of::<T>()
}
#[doc = "Returns the preferred alignment of a type"]
fn pref_align_of<T>() -> uint unsafe {
// FIXME: use rusti::pref_align_of after snapshot
rusti::align_of::<T>()
rusti::pref_align_of::<T>()
}
#[doc = "Returns the refcount of a shared box"]

View File

@ -764,11 +764,6 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
Store(bcx, C_uint(ccx, shape::llsize_of_real(ccx, lltp_ty)),
fcx.llretptr);
}
// FIXME: Transitional. Please remove me.
"align_of" {
Store(bcx, C_uint(ccx, shape::llalign_of_pref(ccx, lltp_ty)),
fcx.llretptr);
}
"min_align_of" {
Store(bcx, C_uint(ccx, shape::llalign_of_min(ccx, lltp_ty)),
fcx.llretptr);

View File

@ -76,7 +76,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
ast_map::node_native_item(i@@{node: native_item_fn(_, _), _}, abi, _) {
if abi == native_abi_rust_intrinsic {
let flags = alt check i.ident {
"size_of" | "align_of" |
"size_of" |
"pref_align_of" | "min_align_of" | "init" |
"reinterpret_cast" { use_repr }
"get_tydesc" | "needs_drop" { use_tydesc }

View File

@ -2007,7 +2007,7 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::native_item) {
}
let tcx = ccx.tcx;
let (n_tps, inputs, output) = alt it.ident {
"size_of" | "align_of" |
"size_of" |
"pref_align_of" | "min_align_of" { (1u, [], ty::mk_uint(ccx.tcx)) }
"get_tydesc" { (1u, [], ty::mk_nil_ptr(tcx)) }
"init" { (1u, [], param(ccx, 0u)) }