@@ -223,7 +223,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
223223 let val = if datum. kind . is_by_ref ( ) {
224224 load_ty ( bcx, datum. val , datum. ty )
225225 } else {
226- datum. val
226+ from_arg_ty ( bcx , datum. val , datum . ty )
227227 } ;
228228
229229 let cast_val = BitCast ( bcx, val, llret_ty) ;
@@ -490,12 +490,12 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
490490 unsafe {
491491 llvm:: LLVMSetAlignment ( load, type_of:: align_of ( ccx, tp_ty) ) ;
492492 }
493- from_arg_ty ( bcx, load, tp_ty)
493+ to_arg_ty ( bcx, load, tp_ty)
494494 } ,
495495 ( _, "volatile_store" ) => {
496496 let tp_ty = * substs. types . get ( FnSpace , 0 ) ;
497497 let ptr = to_arg_ty_ptr ( bcx, llargs[ 0 ] , tp_ty) ;
498- let val = to_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
498+ let val = from_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
499499 let store = VolatileStore ( bcx, val, ptr) ;
500500 unsafe {
501501 llvm:: LLVMSetAlignment ( store, type_of:: align_of ( ccx, tp_ty) ) ;
@@ -777,8 +777,8 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
777777
778778 let tp_ty = * substs. types . get ( FnSpace , 0 ) ;
779779 let ptr = to_arg_ty_ptr ( bcx, llargs[ 0 ] , tp_ty) ;
780- let cmp = to_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
781- let src = to_arg_ty ( bcx, llargs[ 2 ] , tp_ty) ;
780+ let cmp = from_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
781+ let src = from_arg_ty ( bcx, llargs[ 2 ] , tp_ty) ;
782782 let res = AtomicCmpXchg ( bcx, ptr, cmp, src, order,
783783 strongest_failure_ordering) ;
784784 ExtractValue ( bcx, res, 0 )
@@ -787,12 +787,12 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
787787 "load" => {
788788 let tp_ty = * substs. types . get ( FnSpace , 0 ) ;
789789 let ptr = to_arg_ty_ptr ( bcx, llargs[ 0 ] , tp_ty) ;
790- from_arg_ty ( bcx, AtomicLoad ( bcx, ptr, order) , tp_ty)
790+ to_arg_ty ( bcx, AtomicLoad ( bcx, ptr, order) , tp_ty)
791791 }
792792 "store" => {
793793 let tp_ty = * substs. types . get ( FnSpace , 0 ) ;
794794 let ptr = to_arg_ty_ptr ( bcx, llargs[ 0 ] , tp_ty) ;
795- let val = to_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
795+ let val = from_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
796796 AtomicStore ( bcx, val, ptr, order) ;
797797 C_nil ( ccx)
798798 }
@@ -826,7 +826,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
826826
827827 let tp_ty = * substs. types . get ( FnSpace , 0 ) ;
828828 let ptr = to_arg_ty_ptr ( bcx, llargs[ 0 ] , tp_ty) ;
829- let val = to_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
829+ let val = from_arg_ty ( bcx, llargs[ 1 ] , tp_ty) ;
830830 AtomicRMW ( bcx, atom_op, ptr, val, order)
831831 }
832832 }
0 commit comments