// Stores the return value of a function call into it's final location.
Stores the return value of a function call into it's final location.
Stores the return value of a function call into it ' s final location .
fn store_return(
        &mut self,
        bx: &mut Bx,
        dest: ReturnDest<'tcx, Bx::Value>,
        ret_ty: &ArgType<'tcx, Ty<'tcx>>,
        llval: Bx::Value
    ) {
        use self::ReturnDest::*;
        match dest {
            Nothing => (),
            Store(dst) => bx.store_arg_ty(&ret_ty, llval, dst),
            IndirectOperand(tmp, index) => {
                let op = bx.load_operand(tmp);
                tmp.storage_dead(bx);
                self.locals[index] = LocalRef::Operand(Some(op));
            }
            DirectOperand(index) => {
                // If there is a cast, we have to store and reload.
                let op = if let PassMode::Cast(_) = ret_ty.mode {
                    let tmp = PlaceRef::alloca(bx, ret_ty.layout);
                    tmp.storage_live(bx);
                    bx.store_arg_ty(&ret_ty, llval, tmp);
                    let op = bx.load_operand(tmp);
                    tmp.storage_dead(bx);
                    op
                } else {
                    OperandRef::from_immediate_or_packed_pair(bx, llval, ret_ty.layout)
                };
                self.locals[index] = LocalRef::Operand(Some(op));
            }
        }
    }
fn store_return ( & mut self , bx : & mut Bx , dest : ReturnDest < ' tcx , Bx :: Value > , ret_ty : & ArgType < ' tcx , Ty < ' tcx > > , llval : Bx :: Value ) { use self :: ReturnDest :: * ; match dest { Nothing => ( ) , Store ( dst ) => bx . store_arg_ty ( & ret_ty , llval , dst ) , IndirectOperand ( tmp , index ) => { let op = bx . load_operand ( tmp ) ; tmp . storage_dead ( bx ) ; self . locals [ index ] = LocalRef :: Operand ( Some ( op ) ) ; } DirectOperand ( index ) => { // If there is a cast, we have to store and reload. let op = if let PassMode :: Cast ( _ ) = ret_ty . mode { let tmp = PlaceRef :: alloca ( bx , ret_ty . layout ) ; tmp . storage_live ( bx ) ; bx . store_arg_ty ( & ret_ty , llval , tmp ) ; let op = bx . load_operand ( tmp ) ; tmp . storage_dead ( bx ) ; op } else { OperandRef :: from_immediate_or_packed_pair ( bx , llval , ret_ty . layout ) } ; self . locals [ index ] = LocalRef :: Operand ( Some ( op ) ) ; } } }
Stores the return value of a function call into it's final location.
Stores the return value of a function call into it ' s final location .
&mut self
bx
&mut Bx
dest
ReturnDest<'tcx, Bx::Value>
ret_ty
&ArgType<'tcx, Ty<'tcx>>
llval
Bx::Value