@@ -39,17 +39,17 @@ enum MergingSucc {
39
39
40
40
/// Used by `FunctionCx::codegen_terminator` for emitting common patterns
41
41
/// e.g., creating a basic block, calling a function, etc.
42
- struct TerminatorCodegenHelper < ' tcx > {
42
+ struct TerminatorCodegenHelper < ' body , ' tcx > {
43
43
bb : mir:: BasicBlock ,
44
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
44
+ terminator : & ' body mir:: Terminator < ' tcx > ,
45
45
}
46
46
47
- impl < ' a , ' tcx > TerminatorCodegenHelper < ' tcx > {
47
+ impl < ' body , ' a , ' tcx > TerminatorCodegenHelper < ' body , ' tcx > {
48
48
/// Returns the appropriate `Funclet` for the current funclet, if on MSVC,
49
49
/// either already previously cached, or newly created, by `landing_pad_for`.
50
50
fn funclet < ' b , Bx : BuilderMethods < ' a , ' tcx > > (
51
51
& self ,
52
- fx : & ' b mut FunctionCx < ' a , ' tcx , Bx > ,
52
+ fx : & ' b mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
53
53
) -> Option < & ' b Bx :: Funclet > {
54
54
let cleanup_kinds = fx. cleanup_kinds . as_ref ( ) ?;
55
55
let funclet_bb = cleanup_kinds[ self . bb ] . funclet_bb ( self . bb ) ?;
@@ -75,7 +75,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
75
75
/// stuff in it or next to it.
76
76
fn llbb_with_cleanup < Bx : BuilderMethods < ' a , ' tcx > > (
77
77
& self ,
78
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
78
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
79
79
target : mir:: BasicBlock ,
80
80
) -> Bx :: BasicBlock {
81
81
let ( needs_landing_pad, is_cleanupret) = self . llbb_characteristics ( fx, target) ;
@@ -99,7 +99,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
99
99
100
100
fn llbb_characteristics < Bx : BuilderMethods < ' a , ' tcx > > (
101
101
& self ,
102
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
102
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
103
103
target : mir:: BasicBlock ,
104
104
) -> ( bool , bool ) {
105
105
if let Some ( ref cleanup_kinds) = fx. cleanup_kinds {
@@ -124,7 +124,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
124
124
125
125
fn funclet_br < Bx : BuilderMethods < ' a , ' tcx > > (
126
126
& self ,
127
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
127
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
128
128
bx : & mut Bx ,
129
129
target : mir:: BasicBlock ,
130
130
mergeable_succ : bool ,
@@ -153,7 +153,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
153
153
/// return destination `destination` and the unwind action `unwind`.
154
154
fn do_call < Bx : BuilderMethods < ' a , ' tcx > > (
155
155
& self ,
156
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
156
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
157
157
bx : & mut Bx ,
158
158
fn_abi : & ' tcx FnAbi < ' tcx , Ty < ' tcx > > ,
159
159
fn_ptr : Bx :: Value ,
@@ -272,7 +272,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
272
272
/// Generates inline assembly with optional `destination` and `unwind`.
273
273
fn do_inlineasm < Bx : BuilderMethods < ' a , ' tcx > > (
274
274
& self ,
275
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
275
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
276
276
bx : & mut Bx ,
277
277
template : & [ InlineAsmTemplatePiece ] ,
278
278
operands : & [ InlineAsmOperandRef < ' tcx , Bx > ] ,
@@ -339,9 +339,13 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
339
339
}
340
340
341
341
/// Codegen implementations for some terminator variants.
342
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
342
+ impl < ' body , ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' body , ' a , ' tcx , Bx > {
343
343
/// Generates code for a `Resume` terminator.
344
- fn codegen_resume_terminator ( & mut self , helper : TerminatorCodegenHelper < ' tcx > , bx : & mut Bx ) {
344
+ fn codegen_resume_terminator (
345
+ & mut self ,
346
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
347
+ bx : & mut Bx ,
348
+ ) {
345
349
if let Some ( funclet) = helper. funclet ( self ) {
346
350
bx. cleanup_ret ( funclet, None ) ;
347
351
} else {
@@ -358,7 +362,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
358
362
359
363
fn codegen_switchint_terminator (
360
364
& mut self ,
361
- helper : TerminatorCodegenHelper < ' tcx > ,
365
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
362
366
bx : & mut Bx ,
363
367
discr : & mir:: Operand < ' tcx > ,
364
368
targets : & SwitchTargets ,
@@ -498,7 +502,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
498
502
#[ tracing:: instrument( level = "trace" , skip( self , helper, bx) ) ]
499
503
fn codegen_drop_terminator (
500
504
& mut self ,
501
- helper : TerminatorCodegenHelper < ' tcx > ,
505
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
502
506
bx : & mut Bx ,
503
507
source_info : & mir:: SourceInfo ,
504
508
location : mir:: Place < ' tcx > ,
@@ -640,7 +644,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
640
644
641
645
fn codegen_assert_terminator (
642
646
& mut self ,
643
- helper : TerminatorCodegenHelper < ' tcx > ,
647
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
644
648
bx : & mut Bx ,
645
649
terminator : & mir:: Terminator < ' tcx > ,
646
650
cond : & mir:: Operand < ' tcx > ,
@@ -719,7 +723,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
719
723
720
724
fn codegen_terminate_terminator (
721
725
& mut self ,
722
- helper : TerminatorCodegenHelper < ' tcx > ,
726
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
723
727
bx : & mut Bx ,
724
728
terminator : & mir:: Terminator < ' tcx > ,
725
729
reason : UnwindTerminateReason ,
@@ -749,7 +753,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
749
753
/// Returns `Some` if this is indeed a panic intrinsic and codegen is done.
750
754
fn codegen_panic_intrinsic (
751
755
& mut self ,
752
- helper : & TerminatorCodegenHelper < ' tcx > ,
756
+ helper : & TerminatorCodegenHelper < ' body , ' tcx > ,
753
757
bx : & mut Bx ,
754
758
intrinsic : Option < ty:: IntrinsicDef > ,
755
759
instance : Option < Instance < ' tcx > > ,
@@ -818,7 +822,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
818
822
819
823
fn codegen_call_terminator (
820
824
& mut self ,
821
- helper : TerminatorCodegenHelper < ' tcx > ,
825
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
822
826
bx : & mut Bx ,
823
827
terminator : & mir:: Terminator < ' tcx > ,
824
828
func : & mir:: Operand < ' tcx > ,
@@ -1170,7 +1174,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1170
1174
1171
1175
fn codegen_asm_terminator (
1172
1176
& mut self ,
1173
- helper : TerminatorCodegenHelper < ' tcx > ,
1177
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
1174
1178
bx : & mut Bx ,
1175
1179
terminator : & mir:: Terminator < ' tcx > ,
1176
1180
template : & [ ast:: InlineAsmTemplatePiece ] ,
@@ -1254,7 +1258,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1254
1258
}
1255
1259
}
1256
1260
1257
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
1261
+ impl < ' body , ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' body , ' a , ' tcx , Bx > {
1258
1262
pub fn codegen_block ( & mut self , mut bb : mir:: BasicBlock ) {
1259
1263
let llbb = match self . try_llbb ( bb) {
1260
1264
Some ( llbb) => llbb,
@@ -1309,7 +1313,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1309
1313
& mut self ,
1310
1314
bx : & mut Bx ,
1311
1315
bb : mir:: BasicBlock ,
1312
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
1316
+ terminator : & ' body mir:: Terminator < ' tcx > ,
1313
1317
) -> MergingSucc {
1314
1318
debug ! ( "codegen_terminator: {:?}" , terminator) ;
1315
1319
0 commit comments