@@ -483,7 +483,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
483483 _ => unimplemented ! ( "un op Neg for {:?}" , layout. ty) ,
484484 } ,
485485 } ;
486- lval. write_cvalue ( fx, CValue :: ByVal ( res, layout) ) ;
486+ lval. write_cvalue ( fx, CValue :: by_val ( res, layout) ) ;
487487 }
488488 Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) , operand, ty) => {
489489 let layout = fx. layout_of ( ty) ;
@@ -497,7 +497,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
497497 . unwrap ( ) ,
498498 ) ;
499499 let func_addr = fx. bcx . ins ( ) . func_addr ( fx. pointer_type , func_ref) ;
500- lval. write_cvalue ( fx, CValue :: ByVal ( func_addr, layout) ) ;
500+ lval. write_cvalue ( fx, CValue :: by_val ( func_addr, layout) ) ;
501501 }
502502 _ => bug ! ( "Trying to ReifyFnPointer on non FnDef {:?}" , ty) ,
503503 }
@@ -526,7 +526,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
526526 } else {
527527 // fat-ptr -> thin-ptr
528528 let ( ptr, _extra) = operand. load_scalar_pair ( fx) ;
529- lval. write_cvalue ( fx, CValue :: ByVal ( ptr, dest_layout) )
529+ lval. write_cvalue ( fx, CValue :: by_val ( ptr, dest_layout) )
530530 }
531531 } else if let ty:: Adt ( adt_def, _substs) = from_ty. sty {
532532 // enum -> discriminant value
@@ -596,7 +596,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
596596 } else {
597597 unimpl ! ( "rval misc {:?} {:?}" , from_ty, to_ty)
598598 } ;
599- lval. write_cvalue ( fx, CValue :: ByVal ( res, dest_layout) ) ;
599+ lval. write_cvalue ( fx, CValue :: by_val ( res, dest_layout) ) ;
600600 }
601601 }
602602 Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( _) ) , operand, _ty) => {
@@ -611,7 +611,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
611611 ) ;
612612 let func_ref = fx. get_function_ref ( instance) ;
613613 let func_addr = fx. bcx . ins ( ) . func_addr ( fx. pointer_type , func_ref) ;
614- lval. write_cvalue ( fx, CValue :: ByVal ( func_addr, lval. layout ( ) ) ) ;
614+ lval. write_cvalue ( fx, CValue :: by_val ( func_addr, lval. layout ( ) ) ) ;
615615 }
616616 _ => {
617617 bug ! ( "{} cannot be cast to a fn ptr" , operand. layout( ) . ty)
@@ -639,7 +639,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
639639 let place = trans_place ( fx, place) ;
640640 let usize_layout = fx. layout_of ( fx. tcx . types . usize ) ;
641641 let len = codegen_array_len ( fx, place) ;
642- lval. write_cvalue ( fx, CValue :: ByVal ( len, usize_layout) ) ;
642+ lval. write_cvalue ( fx, CValue :: by_val ( len, usize_layout) ) ;
643643 }
644644 Rvalue :: NullaryOp ( NullOp :: Box , content_ty) => {
645645 use rustc:: middle:: lang_items:: ExchangeMallocFnLangItem ;
@@ -666,7 +666,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
666666 let func_ref = fx. get_function_ref ( instance) ;
667667 let call = fx. bcx . ins ( ) . call ( func_ref, & [ llsize, llalign] ) ;
668668 let ptr = fx. bcx . inst_results ( call) [ 0 ] ;
669- lval. write_cvalue ( fx, CValue :: ByVal ( ptr, box_layout) ) ;
669+ lval. write_cvalue ( fx, CValue :: by_val ( ptr, box_layout) ) ;
670670 }
671671 Rvalue :: NullaryOp ( NullOp :: SizeOf , ty) => {
672672 assert ! ( lval
@@ -754,7 +754,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
754754 _ => false ,
755755 } ;
756756 let val = clif_intcast ( fx, lldiscr, fx. clif_type ( dest_layout. ty ) . unwrap ( ) , signed) ;
757- return CValue :: ByVal ( val, dest_layout) ;
757+ return CValue :: by_val ( val, dest_layout) ;
758758 }
759759 layout:: DiscriminantKind :: Niche {
760760 dataful_variant,
@@ -777,7 +777,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
777777 . ins ( )
778778 . iconst ( dest_clif_ty, dataful_variant. as_u32 ( ) as i64 ) ;
779779 let val = fx. bcx . ins ( ) . select ( b, if_true, if_false) ;
780- return CValue :: ByVal ( val, dest_layout) ;
780+ return CValue :: by_val ( val, dest_layout) ;
781781 } else {
782782 // Rebase from niche values to discriminant values.
783783 let delta = niche_start. wrapping_sub ( niche_variants. start ( ) . as_u32 ( ) as u128 ) ;
@@ -795,7 +795,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
795795 . ins ( )
796796 . iconst ( dest_clif_ty, dataful_variant. as_u32 ( ) as i64 ) ;
797797 let val = fx. bcx . ins ( ) . select ( b, if_true, if_false) ;
798- return CValue :: ByVal ( val, dest_layout) ;
798+ return CValue :: by_val ( val, dest_layout) ;
799799 }
800800 }
801801 }
@@ -810,20 +810,20 @@ macro_rules! binop_match {
810810 let ret_layout = $fx. layout_of( $ret_ty) ;
811811
812812 let b = $fx. bcx. ins( ) . icmp( IntCC :: $cc, $lhs, $rhs) ;
813- CValue :: ByVal ( $fx. bcx. ins( ) . bint( types:: I8 , b) , ret_layout)
813+ CValue :: by_val ( $fx. bcx. ins( ) . bint( types:: I8 , b) , ret_layout)
814814 } } ;
815815 ( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, fcmp( $cc: ident) ) => { {
816816 assert_eq!( $fx. tcx. types. bool , $ret_ty) ;
817817 let ret_layout = $fx. layout_of( $ret_ty) ;
818818 let b = $fx. bcx. ins( ) . fcmp( FloatCC :: $cc, $lhs, $rhs) ;
819- CValue :: ByVal ( $fx. bcx. ins( ) . bint( types:: I8 , b) , ret_layout)
819+ CValue :: by_val ( $fx. bcx. ins( ) . bint( types:: I8 , b) , ret_layout)
820820 } } ;
821821 ( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, custom( || $body: expr) ) => { {
822822 $body
823823 } } ;
824824 ( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, $name: ident) => { {
825825 let ret_layout = $fx. layout_of( $ret_ty) ;
826- CValue :: ByVal ( $fx. bcx. ins( ) . $name( $lhs, $rhs) , ret_layout)
826+ CValue :: by_val ( $fx. bcx. ins( ) . $name( $lhs, $rhs) , ret_layout)
827827 } } ;
828828 (
829829 $fx: expr, $bin_op: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, $bug_fmt: expr;
@@ -1064,7 +1064,7 @@ fn trans_ptr_binop<'a, 'tcx: 'a>(
10641064 let ptr_diff = fx. bcx . ins ( ) . imul_imm ( offset, pointee_size as i64 ) ;
10651065 let base_val = base. load_scalar ( fx) ;
10661066 let res = fx. bcx . ins ( ) . iadd ( base_val, ptr_diff) ;
1067- return CValue :: ByVal ( res, base. layout ( ) ) ;
1067+ return CValue :: by_val ( res, base. layout ( ) ) ;
10681068 }
10691069
10701070 binop_match ! {
@@ -1111,7 +1111,7 @@ fn trans_ptr_binop<'a, 'tcx: 'a>(
11111111
11121112 assert_eq ! ( fx. tcx. types. bool , ret_ty) ;
11131113 let ret_layout = fx. layout_of ( ret_ty) ;
1114- CValue :: ByVal ( fx. bcx . ins ( ) . bint ( types:: I8 , res) , ret_layout)
1114+ CValue :: by_val ( fx. bcx . ins ( ) . bint ( types:: I8 , res) , ret_layout)
11151115 }
11161116}
11171117
0 commit comments