@@ -3749,6 +3749,8 @@ fn lval_to_dps(bcx: block, e: @ast::expr, dest: dest) -> block {
3749
3749
let ty = expr_ty ( bcx, e) ;
3750
3750
let lv = trans_lval ( bcx, e) ;
3751
3751
let last_use = ( lv. kind == owned && last_use_map. contains_key ( e. id ) ) ;
3752
+ #debug[ "is last use (%s) = %b, %d" , expr_to_str ( e) , last_use,
3753
+ lv. kind as int ] ;
3752
3754
lval_result_to_dps ( lv, ty, last_use, dest)
3753
3755
}
3754
3756
@@ -4039,29 +4041,10 @@ fn init_local(bcx: block, local: @ast::local) -> block {
4039
4041
let ty = node_id_type ( bcx, local. node . id ) ;
4040
4042
let llptr = alt bcx. fcx . lllocals . find ( local. node . id ) {
4041
4043
some ( local_mem ( v) ) { v }
4042
- some ( _ ) { bcx. tcx ( ) . sess . span_bug ( local. span ,
4044
+ _ { bcx. tcx ( ) . sess . span_bug ( local. span ,
4043
4045
"init_local: Someone forgot to document why it's\
4044
4046
safe to assume local.node.init must be local_mem!") ;
4045
- }
4046
- // This is a local that is kept immediate
4047
- none {
4048
- let initexpr = alt local. node . init {
4049
- some ( { expr, _} ) { expr }
4050
- none { bcx. tcx ( ) . sess . span_bug ( local. span ,
4051
- "init_local: late-initialized var appears to \
4052
- be an immediate -- possibly init_local was called \
4053
- without calling alloc_local") ; }
4054
- } ;
4055
- let mut { bcx, val, kind} = trans_temp_lval ( bcx, initexpr) ;
4056
- if kind != temporary {
4057
- if kind == owned { val = Load ( bcx, val) ; }
4058
- let rs = take_ty_immediate ( bcx, val, ty) ;
4059
- bcx = rs. bcx ; val = rs. val ;
4060
- add_clean_temp ( bcx, val, ty) ;
4061
4047
}
4062
- bcx. fcx . lllocals . insert ( local. node . pat . id , local_imm ( val) ) ;
4063
- ret bcx;
4064
- }
4065
4048
} ;
4066
4049
4067
4050
let mut bcx = bcx;
@@ -4341,17 +4324,6 @@ fn alloc_local(cx: block, local: @ast::local) -> block {
4341
4324
ast:: pat_ident ( pth, none) { some ( path_to_ident ( pth) ) }
4342
4325
_ { none }
4343
4326
} ;
4344
- // Do not allocate space for locals that can be kept immediate.
4345
- let ccx = cx. ccx ( ) ;
4346
- if option:: is_some ( simple_name) &&
4347
- !ccx. maps . mutbl_map . contains_key ( local. node . pat . id ) &&
4348
- !ccx. maps . spill_map . contains_key ( local. node . pat . id ) &&
4349
- ty:: type_is_immediate ( t) {
4350
- alt local. node . init {
4351
- some ( { op: ast:: init_assign, _} ) { ret cx; }
4352
- _ { }
4353
- }
4354
- }
4355
4327
let val = alloc_ty ( cx, t) ;
4356
4328
if cx. sess ( ) . opts . debuginfo {
4357
4329
option:: iter ( simple_name) { |name|
0 commit comments