fn trans_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                expr: &hir::Expr)
                                -> DatumBlock<'blk, 'tcx, Expr> {
    let mut bcx = bcx;

    debug!("trans_unadjusted(expr={:?})", expr);
    let _indenter = indenter();

    debuginfo::set_source_location(bcx.fcx, expr.id, expr.span);

    return match expr_kind(bcx.tcx(), expr) {
        ExprKind::Lvalue | ExprKind::RvalueDatum => {
            let datum = unpack_datum!(bcx, {
                trans_datum_unadjusted(bcx, expr)
            });

            DatumBlock {bcx: bcx, datum: datum}
        }

        ExprKind::RvalueStmt => {
            bcx = trans_rvalue_stmt_unadjusted(bcx, expr);
            nil(bcx, expr_ty(bcx, expr))
        }

        ExprKind::RvalueDps => {
            let ty = expr_ty(bcx, expr);
            if type_is_zero_size(bcx.ccx(), ty) {
                bcx = trans_rvalue_dps_unadjusted(bcx, expr, Ignore);
                nil(bcx, ty)
            } else {
                let scratch = rvalue_scratch_datum(bcx, ty, "");
                bcx = trans_rvalue_dps_unadjusted(
                    bcx, expr, SaveIn(scratch.val));

                // Note: this is not obviously a good idea.  It causes
                // immediate values to be loaded immediately after a
                // return from a call or other similar expression,
                // which in turn leads to alloca's having shorter
                // lifetimes and hence larger stack frames.  However,
                // in turn it can lead to more register pressure.
                // Still, in practice it seems to increase
                // performance, since we have fewer problems with
                // morestack churn.
                let scratch = unpack_datum!(
                    bcx, scratch.to_appropriate_datum(bcx));

                DatumBlock::new(bcx, scratch.to_expr_datum())
            }
        }
    };

    fn nil<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ty: Ty<'tcx>)
                       -> DatumBlock<'blk, 'tcx, Expr> {
        let llval = C_undef(type_of::type_of(bcx.ccx(), ty));
        let datum = immediate_rvalue(llval, ty);
        DatumBlock::new(bcx, datum.to_expr_datum())
    }
}
/// A version of `trans` that ignores adjustments. You almost certainly do not want to call this
/// directly.
A version of `trans` that ignores adjustments. You almost certainly do not want to call this
directly.
A version of ` trans ` that ignores adjustments . You almost certainly do not want to call this directly .
fn trans_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                expr: &hir::Expr)
                                -> DatumBlock<'blk, 'tcx, Expr> {
    let mut bcx = bcx;
    debug!("trans_unadjusted(expr={:?})", expr);
    let _indenter = indenter();
    debuginfo::set_source_location(bcx.fcx, expr.id, expr.span);
    return match expr_kind(bcx.tcx(), expr) {
        ExprKind::Lvalue | ExprKind::RvalueDatum => {
            let datum = unpack_datum!(bcx, {
                trans_datum_unadjusted(bcx, expr)
            });
            DatumBlock {bcx: bcx, datum: datum}
        }
        ExprKind::RvalueStmt => {
            bcx = trans_rvalue_stmt_unadjusted(bcx, expr);
            nil(bcx, expr_ty(bcx, expr))
        }
        ExprKind::RvalueDps => {
            let ty = expr_ty(bcx, expr);
            if type_is_zero_size(bcx.ccx(), ty) {
                bcx = trans_rvalue_dps_unadjusted(bcx, expr, Ignore);
                nil(bcx, ty)
            } else {
                let scratch = rvalue_scratch_datum(bcx, ty, "");
                bcx = trans_rvalue_dps_unadjusted(
                    bcx, expr, SaveIn(scratch.val));
                // Note: this is not obviously a good idea.  It causes
                // immediate values to be loaded immediately after a
                // return from a call or other similar expression,
                // which in turn leads to alloca's having shorter
                // lifetimes and hence larger stack frames.  However,
                // in turn it can lead to more register pressure.
                // Still, in practice it seems to increase
                // performance, since we have fewer problems with
                // morestack churn.
                let scratch = unpack_datum!(
                    bcx, scratch.to_appropriate_datum(bcx));
                DatumBlock::new(bcx, scratch.to_expr_datum())
            }
        }
    };
    fn nil<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ty: Ty<'tcx>)
                       -> DatumBlock<'blk, 'tcx, Expr> {
        let llval = C_undef(type_of::type_of(bcx.ccx(), ty));
        let datum = immediate_rvalue(llval, ty);
        DatumBlock::new(bcx, datum.to_expr_datum())
    }
}
fn trans_unadjusted < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , expr : & hir :: Expr ) -> DatumBlock < ' blk , ' tcx , Expr > { let mut bcx = bcx ; debug ! ( " " expr ) ; let _indenter = indenter ( ) ; debuginfo :: set_source_location ( bcx . fcx , expr . id , expr . span ) ; return match expr_kind ( bcx . tcx ( ) , expr ) { ExprKind :: Lvalue | ExprKind :: RvalueDatum => { let datum = unpack_datum ! ( bcx { trans_datum_unadjusted ( bcx expr ) } ) ; DatumBlock { bcx : bcx , datum : datum } } ExprKind :: RvalueStmt => { bcx = trans_rvalue_stmt_unadjusted ( bcx , expr ) ; nil ( bcx , expr_ty ( bcx , expr ) ) } ExprKind :: RvalueDps => { let ty = expr_ty ( bcx , expr ) ; if type_is_zero_size ( bcx . ccx ( ) , ty ) { bcx = trans_rvalue_dps_unadjusted ( bcx , expr , Ignore ) ; nil ( bcx , ty ) } else { let scratch = rvalue_scratch_datum ( bcx , ty , " " ) ; bcx = trans_rvalue_dps_unadjusted ( bcx , expr , SaveIn ( scratch . val ) ) ; // Note: this is not obviously a good idea.  It causes // immediate values to be loaded immediately after a // return from a call or other similar expression, // which in turn leads to alloca's having shorter // lifetimes and hence larger stack frames.  However, // in turn it can lead to more register pressure. // Still, in practice it seems to increase // performance, since we have fewer problems with // morestack churn. let scratch = unpack_datum ! ( bcx scratch to_appropriate_datum ( bcx ) ) ; DatumBlock :: new ( bcx , scratch . to_expr_datum ( ) ) } } } ; fn nil < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , ty : Ty < ' tcx > ) -> DatumBlock < ' blk , ' tcx , Expr > { let llval = C_undef ( type_of :: type_of ( bcx . ccx ( ) , ty ) ) ; let datum = immediate_rvalue ( llval , ty ) ; DatumBlock :: new ( bcx , datum . to_expr_datum ( ) ) } }
A version of `trans` that ignores adjustments.
A version of ` trans ` that ignores adjustments .
bcx
Block<'blk, 'tcx>
expr
&hir::Expr
bcx
Block<'blk, 'tcx>
expr
&hir::Expr