@@ -483,7 +483,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
483
483
_ => unimplemented ! ( "un op Neg for {:?}" , layout. ty) ,
484
484
} ,
485
485
} ;
486
- lval. write_cvalue ( fx, CValue :: ByVal ( res, layout) ) ;
486
+ lval. write_cvalue ( fx, CValue :: by_val ( res, layout) ) ;
487
487
}
488
488
Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) , operand, ty) => {
489
489
let layout = fx. layout_of ( ty) ;
@@ -497,7 +497,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
497
497
. unwrap ( ) ,
498
498
) ;
499
499
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) ) ;
501
501
}
502
502
_ => bug ! ( "Trying to ReifyFnPointer on non FnDef {:?}" , ty) ,
503
503
}
@@ -526,7 +526,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
526
526
} else {
527
527
// fat-ptr -> thin-ptr
528
528
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) )
530
530
}
531
531
} else if let ty:: Adt ( adt_def, _substs) = from_ty. sty {
532
532
// enum -> discriminant value
@@ -596,7 +596,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
596
596
} else {
597
597
unimpl ! ( "rval misc {:?} {:?}" , from_ty, to_ty)
598
598
} ;
599
- lval. write_cvalue ( fx, CValue :: ByVal ( res, dest_layout) ) ;
599
+ lval. write_cvalue ( fx, CValue :: by_val ( res, dest_layout) ) ;
600
600
}
601
601
}
602
602
Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( _) ) , operand, _ty) => {
@@ -611,7 +611,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
611
611
) ;
612
612
let func_ref = fx. get_function_ref ( instance) ;
613
613
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 ( ) ) ) ;
615
615
}
616
616
_ => {
617
617
bug ! ( "{} cannot be cast to a fn ptr" , operand. layout( ) . ty)
@@ -639,7 +639,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
639
639
let place = trans_place ( fx, place) ;
640
640
let usize_layout = fx. layout_of ( fx. tcx . types . usize ) ;
641
641
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) ) ;
643
643
}
644
644
Rvalue :: NullaryOp ( NullOp :: Box , content_ty) => {
645
645
use rustc:: middle:: lang_items:: ExchangeMallocFnLangItem ;
@@ -666,7 +666,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
666
666
let func_ref = fx. get_function_ref ( instance) ;
667
667
let call = fx. bcx . ins ( ) . call ( func_ref, & [ llsize, llalign] ) ;
668
668
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) ) ;
670
670
}
671
671
Rvalue :: NullaryOp ( NullOp :: SizeOf , ty) => {
672
672
assert ! ( lval
@@ -754,7 +754,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
754
754
_ => false ,
755
755
} ;
756
756
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) ;
758
758
}
759
759
layout:: DiscriminantKind :: Niche {
760
760
dataful_variant,
@@ -777,7 +777,7 @@ pub fn trans_get_discriminant<'a, 'tcx: 'a>(
777
777
. ins ( )
778
778
. iconst ( dest_clif_ty, dataful_variant. as_u32 ( ) as i64 ) ;
779
779
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) ;
781
781
} else {
782
782
// Rebase from niche values to discriminant values.
783
783
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>(
795
795
. ins ( )
796
796
. iconst ( dest_clif_ty, dataful_variant. as_u32 ( ) as i64 ) ;
797
797
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) ;
799
799
}
800
800
}
801
801
}
@@ -810,20 +810,20 @@ macro_rules! binop_match {
810
810
let ret_layout = $fx. layout_of( $ret_ty) ;
811
811
812
812
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)
814
814
} } ;
815
815
( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, fcmp( $cc: ident) ) => { {
816
816
assert_eq!( $fx. tcx. types. bool , $ret_ty) ;
817
817
let ret_layout = $fx. layout_of( $ret_ty) ;
818
818
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)
820
820
} } ;
821
821
( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, custom( || $body: expr) ) => { {
822
822
$body
823
823
} } ;
824
824
( @single $fx: expr, $bug_fmt: expr, $var: expr, $signed: expr, $lhs: expr, $rhs: expr, $ret_ty: expr, $name: ident) => { {
825
825
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)
827
827
} } ;
828
828
(
829
829
$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>(
1064
1064
let ptr_diff = fx. bcx . ins ( ) . imul_imm ( offset, pointee_size as i64 ) ;
1065
1065
let base_val = base. load_scalar ( fx) ;
1066
1066
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 ( ) ) ;
1068
1068
}
1069
1069
1070
1070
binop_match ! {
@@ -1111,7 +1111,7 @@ fn trans_ptr_binop<'a, 'tcx: 'a>(
1111
1111
1112
1112
assert_eq ! ( fx. tcx. types. bool , ret_ty) ;
1113
1113
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)
1115
1115
}
1116
1116
}
1117
1117
0 commit comments