trans: Decide whether to load volatile_store's argument based on its ArgType.

This commit is contained in:
Eduard Burtescu 2016-03-18 05:29:53 +02:00
parent d6689e5d1c
commit 181097da33

@ -589,10 +589,10 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
},
(_, "volatile_store") => {
let tp_ty = *substs.types.get(FnSpace, 0);
let val = if type_is_immediate(bcx.ccx(), tp_ty) {
from_immediate(bcx, llargs[1])
} else {
let val = if fn_ty.args[1].is_indirect() {
Load(bcx, llargs[1])
} else {
from_immediate(bcx, llargs[1])
};
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
let store = VolatileStore(bcx, val, ptr);