1
Fork 0

Remove old-moded atomic intrinsics (#3200)

This commit is contained in:
Ben Blum 2012-08-23 14:52:56 -04:00
parent c47342e7c2
commit caceac06ce
3 changed files with 11 additions and 29 deletions

View file

@ -800,65 +800,63 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::foreign_item,
some(substs), some(item.span));
let mut bcx = top_scope_block(fcx, none), lltop = bcx.llbb;
match ccx.sess.str_of(item.ident) {
// NB: Transitionary, de-mode-ing. Remove the first string of each
// pattern when the old intrinsics are gone.
~"atomic_xchng" | ~"atomic_xchg" => {
~"atomic_xchg" => {
let old = AtomicRMW(bcx, Xchg,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
SequentiallyConsistent);
Store(bcx, old, fcx.llretptr);
}
~"atomic_xchng_acq" | ~"atomic_xchg_acq" => {
~"atomic_xchg_acq" => {
let old = AtomicRMW(bcx, Xchg,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
Acquire);
Store(bcx, old, fcx.llretptr);
}
~"atomic_xchng_rel" | ~"atomic_xchg_rel" => {
~"atomic_xchg_rel" => {
let old = AtomicRMW(bcx, Xchg,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
Release);
Store(bcx, old, fcx.llretptr);
}
~"atomic_add" | ~"atomic_xadd" => {
~"atomic_xadd" => {
let old = AtomicRMW(bcx, lib::llvm::Add,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
SequentiallyConsistent);
Store(bcx, old, fcx.llretptr);
}
~"atomic_add_acq" | ~"atomic_xadd_acq" => {
~"atomic_xadd_acq" => {
let old = AtomicRMW(bcx, lib::llvm::Add,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
Acquire);
Store(bcx, old, fcx.llretptr);
}
~"atomic_add_rel" | ~"atomic_xadd_rel" => {
~"atomic_xadd_rel" => {
let old = AtomicRMW(bcx, lib::llvm::Add,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
Release);
Store(bcx, old, fcx.llretptr);
}
~"atomic_sub" | ~"atomic_xsub" => {
~"atomic_xsub" => {
let old = AtomicRMW(bcx, lib::llvm::Sub,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
SequentiallyConsistent);
Store(bcx, old, fcx.llretptr);
}
~"atomic_sub_acq" | ~"atomic_xsub_acq" => {
~"atomic_xsub_acq" => {
let old = AtomicRMW(bcx, lib::llvm::Sub,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),
Acquire);
Store(bcx, old, fcx.llretptr);
}
~"atomic_sub_rel" | ~"atomic_xsub_rel" => {
~"atomic_xsub_rel" => {
let old = AtomicRMW(bcx, lib::llvm::Sub,
get_param(decl, first_real_arg),
get_param(decl, first_real_arg + 1u),

View file

@ -90,16 +90,10 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
~"get_tydesc" | ~"needs_drop" => {
use_tydesc
}
// NB: new intrinsics
~"atomic_xchg" | ~"atomic_xadd" | ~"atomic_xsub" |
~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" |
// old intrinsics
~"atomic_xchng" | ~"atomic_add" | ~"atomic_sub" |
~"atomic_xchng_acq" | ~"atomic_add_acq" | ~"atomic_sub_acq" |
~"atomic_xchng_rel" | ~"atomic_add_rel" | ~"atomic_sub_rel" => {
0u
}
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" =>
{ 0u }
~"visit_tydesc" | ~"forget" | ~"addr_of" => {
0u
}

View file

@ -2508,16 +2508,6 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::foreign_item) {
}
~"needs_drop" => (1u, ~[], ty::mk_bool(tcx)),
// NB: Old intrinsics.
~"atomic_xchng" | ~"atomic_add" | ~"atomic_sub" |
~"atomic_xchng_acq" | ~"atomic_add_acq" | ~"atomic_sub_acq" |
~"atomic_xchng_rel" | ~"atomic_add_rel" | ~"atomic_sub_rel" => {
(0u, ~[arg(ast::by_mutbl_ref, ty::mk_int(tcx)),
arg(ast::by_val, ty::mk_int(tcx))],
ty::mk_int(tcx))
}
// NB: Transitionary, de-mode-ing.
~"atomic_xchg" | ~"atomic_xadd" | ~"atomic_xsub" |
~"atomic_xchg_acq" | ~"atomic_xadd_acq" | ~"atomic_xsub_acq" |
~"atomic_xchg_rel" | ~"atomic_xadd_rel" | ~"atomic_xsub_rel" => {