@@ -555,20 +555,20 @@ impl<'a, 'tcx> ArgType<'tcx> {
555
555
/// place for the original Rust type of this argument/return.
556
556
/// Can be used for both storing formal arguments into Rust variables
557
557
/// or results of call/invoke instructions into their destinations.
558
- pub fn store ( & self , bcx : & Builder < ' a , ' tcx > , val : ValueRef , dst : PlaceRef < ' tcx > ) {
558
+ pub fn store ( & self , bx : & Builder < ' a , ' tcx > , val : ValueRef , dst : PlaceRef < ' tcx > ) {
559
559
if self . is_ignore ( ) {
560
560
return ;
561
561
}
562
- let cx = bcx . cx ;
562
+ let cx = bx . cx ;
563
563
if self . is_indirect ( ) {
564
- OperandValue :: Ref ( val, self . layout . align ) . store ( bcx , dst)
564
+ OperandValue :: Ref ( val, self . layout . align ) . store ( bx , dst)
565
565
} else if let PassMode :: Cast ( cast) = self . mode {
566
566
// FIXME(eddyb): Figure out when the simpler Store is safe, clang
567
567
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
568
568
let can_store_through_cast_ptr = false ;
569
569
if can_store_through_cast_ptr {
570
- let cast_dst = bcx . pointercast ( dst. llval , cast. llvm_type ( cx) . ptr_to ( ) ) ;
571
- bcx . store ( val, cast_dst, self . layout . align ) ;
570
+ let cast_dst = bx . pointercast ( dst. llval , cast. llvm_type ( cx) . ptr_to ( ) ) ;
571
+ bx . store ( val, cast_dst, self . layout . align ) ;
572
572
} else {
573
573
// The actual return type is a struct, but the ABI
574
574
// adaptation code has cast it into some scalar type. The
@@ -587,42 +587,42 @@ impl<'a, 'tcx> ArgType<'tcx> {
587
587
// We instead thus allocate some scratch space...
588
588
let scratch_size = cast. size ( cx) ;
589
589
let scratch_align = cast. align ( cx) ;
590
- let llscratch = bcx . alloca ( cast. llvm_type ( cx) , "abi_cast" , scratch_align) ;
591
- bcx . lifetime_start ( llscratch, scratch_size) ;
590
+ let llscratch = bx . alloca ( cast. llvm_type ( cx) , "abi_cast" , scratch_align) ;
591
+ bx . lifetime_start ( llscratch, scratch_size) ;
592
592
593
593
// ...where we first store the value...
594
- bcx . store ( val, llscratch, scratch_align) ;
594
+ bx . store ( val, llscratch, scratch_align) ;
595
595
596
596
// ...and then memcpy it to the intended destination.
597
- base:: call_memcpy ( bcx ,
598
- bcx . pointercast ( dst. llval , Type :: i8p ( cx) ) ,
599
- bcx . pointercast ( llscratch, Type :: i8p ( cx) ) ,
597
+ base:: call_memcpy ( bx ,
598
+ bx . pointercast ( dst. llval , Type :: i8p ( cx) ) ,
599
+ bx . pointercast ( llscratch, Type :: i8p ( cx) ) ,
600
600
C_usize ( cx, self . layout . size . bytes ( ) ) ,
601
601
self . layout . align . min ( scratch_align) ) ;
602
602
603
- bcx . lifetime_end ( llscratch, scratch_size) ;
603
+ bx . lifetime_end ( llscratch, scratch_size) ;
604
604
}
605
605
} else {
606
- OperandValue :: Immediate ( val) . store ( bcx , dst) ;
606
+ OperandValue :: Immediate ( val) . store ( bx , dst) ;
607
607
}
608
608
}
609
609
610
- pub fn store_fn_arg ( & self , bcx : & Builder < ' a , ' tcx > , idx : & mut usize , dst : PlaceRef < ' tcx > ) {
610
+ pub fn store_fn_arg ( & self , bx : & Builder < ' a , ' tcx > , idx : & mut usize , dst : PlaceRef < ' tcx > ) {
611
611
if self . pad . is_some ( ) {
612
612
* idx += 1 ;
613
613
}
614
614
let mut next = || {
615
- let val = llvm:: get_param ( bcx . llfn ( ) , * idx as c_uint ) ;
615
+ let val = llvm:: get_param ( bx . llfn ( ) , * idx as c_uint ) ;
616
616
* idx += 1 ;
617
617
val
618
618
} ;
619
619
match self . mode {
620
620
PassMode :: Ignore => { } ,
621
621
PassMode :: Pair ( ..) => {
622
- OperandValue :: Pair ( next ( ) , next ( ) ) . store ( bcx , dst) ;
622
+ OperandValue :: Pair ( next ( ) , next ( ) ) . store ( bx , dst) ;
623
623
}
624
624
PassMode :: Direct ( _) | PassMode :: Indirect ( _) | PassMode :: Cast ( _) => {
625
- self . store ( bcx , next ( ) , dst) ;
625
+ self . store ( bx , next ( ) , dst) ;
626
626
}
627
627
}
628
628
}
0 commit comments