@@ -102,7 +102,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
102
102
} ;
103
103
104
104
let funclet_br =
105
- |this : & mut Self , bx : & Bx , target : mir:: BasicBlock | {
105
+ |this : & mut Self , bx : & mut Bx , target : mir:: BasicBlock | {
106
106
let ( lltarget, is_cleanupret) = lltarget ( this, target) ;
107
107
if is_cleanupret {
108
108
// micro-optimization: generate a `ret` rather than a jump
@@ -115,7 +115,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
115
115
116
116
let do_call = |
117
117
this : & mut Self ,
118
- bx : & Bx ,
118
+ bx : & mut Bx ,
119
119
fn_ty : FnType < ' tcx , Ty < ' tcx > > ,
120
120
fn_ptr : Cx :: Value ,
121
121
llargs : & [ Cx :: Value ] ,
@@ -191,7 +191,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
191
191
}
192
192
193
193
mir:: TerminatorKind :: Goto { target } => {
194
- funclet_br ( self , & bx, target) ;
194
+ funclet_br ( self , & mut bx, target) ;
195
195
}
196
196
197
197
mir:: TerminatorKind :: SwitchInt { ref discr, switch_ty, ref values, ref targets } => {
@@ -293,7 +293,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
293
293
294
294
if let ty:: InstanceDef :: DropGlue ( _, None ) = drop_fn. def {
295
295
// we don't actually need to drop anything.
296
- funclet_br ( self , & bx, target) ;
296
+ funclet_br ( self , & mut bx, target) ;
297
297
return
298
298
}
299
299
@@ -324,7 +324,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
324
324
bx. cx ( ) . fn_type_of_instance ( & drop_fn) )
325
325
}
326
326
} ;
327
- do_call ( self , & bx, fn_ty, drop_fn, args,
327
+ do_call ( self , & mut bx, fn_ty, drop_fn, args,
328
328
Some ( ( ReturnDest :: Nothing , target) ) ,
329
329
unwind) ;
330
330
}
@@ -348,7 +348,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
348
348
349
349
// Don't codegen the panic block if success if known.
350
350
if const_cond == Some ( expected) {
351
- funclet_br ( self , & bx, target) ;
351
+ funclet_br ( self , & mut bx, target) ;
352
352
return ;
353
353
}
354
354
@@ -419,7 +419,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
419
419
let llfn = bx. cx ( ) . get_fn ( instance) ;
420
420
421
421
// Codegen the actual panic invoke/call.
422
- do_call ( self , & bx, fn_ty, llfn, & args, None , cleanup) ;
422
+ do_call ( self , & mut bx, fn_ty, llfn, & args, None , cleanup) ;
423
423
}
424
424
425
425
mir:: TerminatorKind :: DropAndReplace { .. } => {
@@ -469,7 +469,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
469
469
if let Some ( destination_ref) = destination. as_ref ( ) {
470
470
let & ( ref dest, target) = destination_ref;
471
471
self . codegen_transmute ( & bx, & args[ 0 ] , dest) ;
472
- funclet_br ( self , & bx, target) ;
472
+ funclet_br ( self , & mut bx, target) ;
473
473
} else {
474
474
// If we are trying to transmute to an uninhabited type,
475
475
// it is likely there is no allotted destination. In fact,
@@ -496,7 +496,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
496
496
Some ( ty:: InstanceDef :: DropGlue ( _, None ) ) => {
497
497
// empty drop glue - a nop.
498
498
let & ( _, target) = destination. as_ref ( ) . unwrap ( ) ;
499
- funclet_br ( self , & bx, target) ;
499
+ funclet_br ( self , & mut bx, target) ;
500
500
return ;
501
501
}
502
502
_ => bx. cx ( ) . new_fn_type ( sig, & extra_args)
@@ -542,7 +542,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
542
542
// Codegen the actual panic invoke/call.
543
543
do_call (
544
544
self ,
545
- & bx,
545
+ & mut bx,
546
546
fn_ty,
547
547
llfn,
548
548
& [ msg_file_line_col] ,
@@ -640,7 +640,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
640
640
}
641
641
642
642
if let Some ( ( _, target) ) = * destination {
643
- funclet_br ( self , & bx, target) ;
643
+ funclet_br ( self , & mut bx, target) ;
644
644
} else {
645
645
bx. unreachable ( ) ;
646
646
}
@@ -692,7 +692,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
692
692
_ => span_bug ! ( span, "no llfn for call" ) ,
693
693
} ;
694
694
695
- do_call ( self , & bx, fn_ty, fn_ptr, & llargs,
695
+ do_call ( self , & mut bx, fn_ty, fn_ptr, & llargs,
696
696
destination. as_ref ( ) . map ( |& ( _, target) | ( ret_dest, target) ) ,
697
697
cleanup) ;
698
698
}
@@ -864,7 +864,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
864
864
span_bug ! ( self . mir. span, "landing pad was not inserted?" )
865
865
}
866
866
867
- let bx : Bx = self . new_block ( "cleanup" ) ;
867
+ let mut bx : Bx = self . new_block ( "cleanup" ) ;
868
868
869
869
let llpersonality = self . cx . eh_personality ( ) ;
870
870
let llretty = self . landing_pad_type ( ) ;
@@ -903,7 +903,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
903
903
& self ,
904
904
bb : mir:: BasicBlock
905
905
) -> Bx {
906
- let bx = Bx :: with_cx ( self . cx ) ;
906
+ let mut bx = Bx :: with_cx ( self . cx ) ;
907
907
bx. position_at_end ( self . blocks [ bb] ) ;
908
908
bx
909
909
}
0 commit comments