// 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,
                    bcx: &BlockAndBuilder<'bcx, 'tcx>,
                    dest: ReturnDest,
                    ret_ty: ArgType,
                    op: OperandRef<'tcx>) {
        use self::ReturnDest::*;
        match dest {
            Nothing => (),
            Store(dst) => ret_ty.store(bcx, op.immediate(), dst),
            IndirectOperand(tmp, index) => {
                let op = self.trans_load(bcx, tmp, op.ty);
                self.locals[index] = LocalRef::Operand(Some(op));
            }
            DirectOperand(index) => {
                // If there is a cast, we have to store and reload.
                let op = if ret_ty.cast.is_some() {
                    let tmp = bcx.with_block(|bcx| {
                        base::alloc_ty(bcx, op.ty, "tmp_ret")
                    });
                    ret_ty.store(bcx, op.immediate(), tmp);
                    self.trans_load(bcx, tmp, op.ty)
                } else {
                    op.unpack_if_pair(bcx)
                };
                self.locals[index] = LocalRef::Operand(Some(op));
            }
        }
    }
fn store_return ( & mut self , bcx : & BlockAndBuilder < ' bcx , ' tcx > , dest : ReturnDest , ret_ty : ArgType , op : OperandRef < ' tcx > ) { use self :: ReturnDest :: * ; match dest { Nothing => ( ) , Store ( dst ) => ret_ty . store ( bcx , op . immediate ( ) , dst ) , IndirectOperand ( tmp , index ) => { let op = self . trans_load ( bcx , tmp , op . ty ) ; self . locals [ index ] = LocalRef :: Operand ( Some ( op ) ) ; } DirectOperand ( index ) => { // If there is a cast, we have to store and reload. let op = if ret_ty . cast . is_some ( ) { let tmp = bcx . with_block ( | bcx | { base :: alloc_ty ( bcx , op . ty , " " ) } ) ; ret_ty . store ( bcx , op . immediate ( ) , tmp ) ; self . trans_load ( bcx , tmp , op . ty ) } else { op . unpack_if_pair ( bcx ) } ; 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
bcx
&BlockAndBuilder<'bcx, 'tcx>
dest
ReturnDest
ret_ty
ArgType
op
OperandRef<'tcx>