From caceac06ce645e4a36637eedc25f5334369b6bbe Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Thu, 23 Aug 2012 14:52:56 -0400 Subject: [PATCH] Remove old-moded atomic intrinsics (#3200) --- src/rustc/middle/trans/foreign.rs | 20 +++++++++----------- src/rustc/middle/trans/type_use.rs | 10 ++-------- src/rustc/middle/typeck/check.rs | 10 ---------- 3 files changed, 11 insertions(+), 29 deletions(-) diff --git a/src/rustc/middle/trans/foreign.rs b/src/rustc/middle/trans/foreign.rs index d5255bd17137..10e657af0f4e 100644 --- a/src/rustc/middle/trans/foreign.rs +++ b/src/rustc/middle/trans/foreign.rs @@ -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), diff --git a/src/rustc/middle/trans/type_use.rs b/src/rustc/middle/trans/type_use.rs index 1b084670f94e..004de82e064d 100644 --- a/src/rustc/middle/trans/type_use.rs +++ b/src/rustc/middle/trans/type_use.rs @@ -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 } diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index 7920286fcddb..7b71c59bf26e 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -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" => {