@@ -38,17 +38,17 @@ enum MergingSucc {
38
38
39
39
/// Used by `FunctionCx::codegen_terminator` for emitting common patterns
40
40
/// e.g., creating a basic block, calling a function, etc.
41
- struct TerminatorCodegenHelper < ' tcx > {
41
+ struct TerminatorCodegenHelper < ' body , ' tcx > {
42
42
bb : mir:: BasicBlock ,
43
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
43
+ terminator : & ' body mir:: Terminator < ' tcx > ,
44
44
}
45
45
46
- impl < ' a , ' tcx > TerminatorCodegenHelper < ' tcx > {
46
+ impl < ' body , ' a , ' tcx > TerminatorCodegenHelper < ' body , ' tcx > {
47
47
/// Returns the appropriate `Funclet` for the current funclet, if on MSVC,
48
48
/// either already previously cached, or newly created, by `landing_pad_for`.
49
49
fn funclet < ' b , Bx : BuilderMethods < ' a , ' tcx > > (
50
50
& self ,
51
- fx : & ' b mut FunctionCx < ' a , ' tcx , Bx > ,
51
+ fx : & ' b mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
52
52
) -> Option < & ' b Bx :: Funclet > {
53
53
let cleanup_kinds = fx. cleanup_kinds . as_ref ( ) ?;
54
54
let funclet_bb = cleanup_kinds[ self . bb ] . funclet_bb ( self . bb ) ?;
@@ -74,7 +74,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
74
74
/// stuff in it or next to it.
75
75
fn llbb_with_cleanup < Bx : BuilderMethods < ' a , ' tcx > > (
76
76
& self ,
77
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
77
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
78
78
target : mir:: BasicBlock ,
79
79
) -> Bx :: BasicBlock {
80
80
let ( needs_landing_pad, is_cleanupret) = self . llbb_characteristics ( fx, target) ;
@@ -98,7 +98,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
98
98
99
99
fn llbb_characteristics < Bx : BuilderMethods < ' a , ' tcx > > (
100
100
& self ,
101
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
101
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
102
102
target : mir:: BasicBlock ,
103
103
) -> ( bool , bool ) {
104
104
if let Some ( ref cleanup_kinds) = fx. cleanup_kinds {
@@ -123,7 +123,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
123
123
124
124
fn funclet_br < Bx : BuilderMethods < ' a , ' tcx > > (
125
125
& self ,
126
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
126
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
127
127
bx : & mut Bx ,
128
128
target : mir:: BasicBlock ,
129
129
mergeable_succ : bool ,
@@ -152,7 +152,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
152
152
/// return destination `destination` and the unwind action `unwind`.
153
153
fn do_call < Bx : BuilderMethods < ' a , ' tcx > > (
154
154
& self ,
155
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
155
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
156
156
bx : & mut Bx ,
157
157
fn_abi : & ' tcx FnAbi < ' tcx , Ty < ' tcx > > ,
158
158
fn_ptr : Bx :: Value ,
@@ -271,7 +271,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
271
271
/// Generates inline assembly with optional `destination` and `unwind`.
272
272
fn do_inlineasm < Bx : BuilderMethods < ' a , ' tcx > > (
273
273
& self ,
274
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
274
+ fx : & mut FunctionCx < ' body , ' a , ' tcx , Bx > ,
275
275
bx : & mut Bx ,
276
276
template : & [ InlineAsmTemplatePiece ] ,
277
277
operands : & [ InlineAsmOperandRef < ' tcx , Bx > ] ,
@@ -338,9 +338,13 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
338
338
}
339
339
340
340
/// Codegen implementations for some terminator variants.
341
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
341
+ impl < ' body , ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' body , ' a , ' tcx , Bx > {
342
342
/// Generates code for a `Resume` terminator.
343
- fn codegen_resume_terminator ( & mut self , helper : TerminatorCodegenHelper < ' tcx > , bx : & mut Bx ) {
343
+ fn codegen_resume_terminator (
344
+ & mut self ,
345
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
346
+ bx : & mut Bx ,
347
+ ) {
344
348
if let Some ( funclet) = helper. funclet ( self ) {
345
349
bx. cleanup_ret ( funclet, None ) ;
346
350
} else {
@@ -357,7 +361,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
357
361
358
362
fn codegen_switchint_terminator (
359
363
& mut self ,
360
- helper : TerminatorCodegenHelper < ' tcx > ,
364
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
361
365
bx : & mut Bx ,
362
366
discr : & mir:: Operand < ' tcx > ,
363
367
targets : & SwitchTargets ,
@@ -497,7 +501,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
497
501
#[ tracing:: instrument( level = "trace" , skip( self , helper, bx) ) ]
498
502
fn codegen_drop_terminator (
499
503
& mut self ,
500
- helper : TerminatorCodegenHelper < ' tcx > ,
504
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
501
505
bx : & mut Bx ,
502
506
location : mir:: Place < ' tcx > ,
503
507
target : mir:: BasicBlock ,
@@ -622,7 +626,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
622
626
623
627
fn codegen_assert_terminator (
624
628
& mut self ,
625
- helper : TerminatorCodegenHelper < ' tcx > ,
629
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
626
630
bx : & mut Bx ,
627
631
terminator : & mir:: Terminator < ' tcx > ,
628
632
cond : & mir:: Operand < ' tcx > ,
@@ -701,7 +705,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
701
705
702
706
fn codegen_terminate_terminator (
703
707
& mut self ,
704
- helper : TerminatorCodegenHelper < ' tcx > ,
708
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
705
709
bx : & mut Bx ,
706
710
terminator : & mir:: Terminator < ' tcx > ,
707
711
reason : UnwindTerminateReason ,
@@ -731,7 +735,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
731
735
/// Returns `Some` if this is indeed a panic intrinsic and codegen is done.
732
736
fn codegen_panic_intrinsic (
733
737
& mut self ,
734
- helper : & TerminatorCodegenHelper < ' tcx > ,
738
+ helper : & TerminatorCodegenHelper < ' body , ' tcx > ,
735
739
bx : & mut Bx ,
736
740
intrinsic : Option < ty:: IntrinsicDef > ,
737
741
instance : Option < Instance < ' tcx > > ,
@@ -800,7 +804,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
800
804
801
805
fn codegen_call_terminator (
802
806
& mut self ,
803
- helper : TerminatorCodegenHelper < ' tcx > ,
807
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
804
808
bx : & mut Bx ,
805
809
terminator : & mir:: Terminator < ' tcx > ,
806
810
func : & mir:: Operand < ' tcx > ,
@@ -1152,7 +1156,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1152
1156
1153
1157
fn codegen_asm_terminator (
1154
1158
& mut self ,
1155
- helper : TerminatorCodegenHelper < ' tcx > ,
1159
+ helper : TerminatorCodegenHelper < ' body , ' tcx > ,
1156
1160
bx : & mut Bx ,
1157
1161
terminator : & mir:: Terminator < ' tcx > ,
1158
1162
template : & [ ast:: InlineAsmTemplatePiece ] ,
@@ -1236,7 +1240,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1236
1240
}
1237
1241
}
1238
1242
1239
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
1243
+ impl < ' body , ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' body , ' a , ' tcx , Bx > {
1240
1244
pub fn codegen_block ( & mut self , mut bb : mir:: BasicBlock ) {
1241
1245
let llbb = match self . try_llbb ( bb) {
1242
1246
Some ( llbb) => llbb,
@@ -1291,7 +1295,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1291
1295
& mut self ,
1292
1296
bx : & mut Bx ,
1293
1297
bb : mir:: BasicBlock ,
1294
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
1298
+ terminator : & ' body mir:: Terminator < ' tcx > ,
1295
1299
) -> MergingSucc {
1296
1300
debug ! ( "codegen_terminator: {:?}" , terminator) ;
1297
1301
0 commit comments