Skip to content

Commit 29f4d0e

Browse files
committed
Added new lifetimes for Funclets in FunctionsCx -> compiles
1 parent da0cf8c commit 29f4d0e

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/librustc_codegen_llvm/mir/analyze.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use type_of::LayoutLlvmExt;
2323
use super::FunctionCx;
2424
use interfaces::*;
2525

26-
pub fn non_ssa_locals<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>(
27-
fx: &FunctionCx<'a, 'll, 'tcx, Cx>
26+
pub fn non_ssa_locals<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>(
27+
fx: &FunctionCx<'a, 'f, 'll, 'tcx, Cx>
2828
) -> BitSet<mir::Local>
2929
where &'a Cx : LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
3030
{
@@ -56,19 +56,19 @@ pub fn non_ssa_locals<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>
5656
analyzer.non_ssa_locals
5757
}
5858

59-
struct LocalAnalyzer<'mir, 'a: 'mir, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> {
60-
fx: &'mir FunctionCx<'a, 'll, 'tcx, Cx>,
59+
struct LocalAnalyzer<'mir, 'a: 'mir, 'f: 'mir, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> {
60+
fx: &'mir FunctionCx<'a, 'f, 'll, 'tcx, Cx>,
6161
dominators: Dominators<mir::BasicBlock>,
6262
non_ssa_locals: BitSet<mir::Local>,
6363
// The location of the first visited direct assignment to each
6464
// local, or an invalid location (out of bounds `block` index).
6565
first_assignment: IndexVec<mir::Local, Location>
6666
}
6767

68-
impl<Cx: 'a + CodegenMethods<'ll, 'tcx>> LocalAnalyzer<'mir, 'a, 'll, 'tcx, Cx>
68+
impl<Cx: 'a + CodegenMethods<'ll, 'tcx>> LocalAnalyzer<'mir, 'a, 'f, 'll, 'tcx, Cx>
6969
where &'a Cx : LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
7070
{
71-
fn new(fx: &'mir FunctionCx<'a, 'll, 'tcx, Cx>) -> Self {
71+
fn new(fx: &'mir FunctionCx<'a, 'f, 'll, 'tcx, Cx>) -> Self {
7272
let invalid_location =
7373
mir::BasicBlock::new(fx.mir.basic_blocks().len()).start_location();
7474
let mut analyzer = LocalAnalyzer {
@@ -109,8 +109,8 @@ impl<Cx: 'a + CodegenMethods<'ll, 'tcx>> LocalAnalyzer<'mir, 'a, 'll, 'tcx, Cx>
109109
}
110110
}
111111

112-
impl<'mir, 'a: 'mir, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> Visitor<'tcx>
113-
for LocalAnalyzer<'mir, 'a, 'll, 'tcx, Cx>
112+
impl<'mir, 'a: 'mir, 'f: 'mir, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> Visitor<'tcx>
113+
for LocalAnalyzer<'mir, 'a, 'f, 'll, 'tcx, Cx>
114114
where &'a Cx : LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
115115
{
116116
fn visit_assign(&mut self,

src/librustc_codegen_llvm/mir/block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ use super::place::PlaceRef;
3131
use super::operand::OperandRef;
3232
use super::operand::OperandValue::{Pair, Ref, Immediate};
3333

34-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
35-
FunctionCx<'a, 'll, 'tcx, Cx>
34+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
35+
FunctionCx<'a, 'f, 'll, 'tcx, Cx>
3636
where &'a Cx: LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
3737
{
3838
pub fn codegen_block<Bx: BuilderMethods<'a, 'll, 'tcx>>(&mut self, bb: mir::BasicBlock)

src/librustc_codegen_llvm/mir/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn codegen_static_initializer(
7777
Ok((const_alloc_to_llvm(cx, alloc), alloc))
7878
}
7979

80-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx>
80+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx>
8181
where &'a Cx: LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
8282
{
8383
fn fully_evaluate<Bx: BuilderMethods<'a, 'll, 'tcx, CodegenCx=Cx>>(

src/librustc_codegen_llvm/mir/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use rustc::mir::traversal;
3939
use self::operand::{OperandRef, OperandValue};
4040

4141
/// Master context for codegenning from MIR.
42-
pub struct FunctionCx<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> {
42+
pub struct FunctionCx<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> {
4343
instance: Instance<'tcx>,
4444

4545
mir: &'a mir::Mir<'tcx>,
@@ -70,7 +70,7 @@ pub struct FunctionCx<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx
7070
/// When targeting MSVC, this stores the cleanup info for each funclet
7171
/// BB. Thisrustup component add rustfmt-preview is initialized as we compute the funclets'
7272
/// head block in RPO.
73-
funclets: &'ll IndexVec<mir::BasicBlock, Option<Funclet<'ll, Cx::Value>>>,
73+
funclets: &'f IndexVec<mir::BasicBlock, Option<Funclet<'ll, Cx::Value>>>,
7474

7575
/// This stores the landing-pad block for a given BB, computed lazily on GNU
7676
/// and eagerly on MSVC.
@@ -103,8 +103,8 @@ pub struct FunctionCx<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx
103103
param_substs: &'tcx Substs<'tcx>,
104104
}
105105

106-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>
107-
FunctionCx<'a, 'll, 'tcx, Cx>
106+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>
107+
FunctionCx<'a, 'f, 'll, 'tcx, Cx>
108108
{
109109
pub fn monomorphize<T>(&self, value: &T) -> T
110110
where T: TypeFoldable<'tcx>
@@ -117,8 +117,8 @@ impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>
117117
}
118118
}
119119

120-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>
121-
FunctionCx<'a, 'll, 'tcx, Cx>
120+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>>
121+
FunctionCx<'a, 'f, 'll, 'tcx, Cx>
122122
{
123123
pub fn set_debug_loc<Bx: BuilderMethods<'a, 'll, 'tcx>>(
124124
&mut self,
@@ -440,9 +440,9 @@ fn create_funclets<'a, 'll: 'a, 'tcx: 'll, Bx: BuilderMethods<'a, 'll, 'tcx>>(
440440
/// Produce, for each argument, a `Value` pointing at the
441441
/// argument's value. As arguments are places, these are always
442442
/// indirect.
443-
fn arg_local_refs<'a, 'll: 'a, 'tcx: 'll, Bx: BuilderMethods<'a, 'll, 'tcx>>(
443+
fn arg_local_refs<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Bx: BuilderMethods<'a, 'll, 'tcx>>(
444444
bx: &Bx,
445-
fx: &FunctionCx<'a, 'll, 'tcx, Bx::CodegenCx>,
445+
fx: &FunctionCx<'a, 'f, 'll, 'tcx, Bx::CodegenCx>,
446446
scopes: &IndexVec<
447447
mir::SourceScope,
448448
debuginfo::MirDebugScope<<Bx::CodegenCx as DebugInfoMethods<'ll, 'tcx>>::DIScope>

src/librustc_codegen_llvm/mir/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ impl<'a, 'll: 'a, 'tcx: 'll, V : 'll + CodegenObject> OperandValue<V> {
384384
}
385385
}
386386

387-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx> {
387+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx> {
388388
fn maybe_codegen_consume_direct<Bx: BuilderMethods<'a, 'll, 'tcx, CodegenCx=Cx>>(
389389
&mut self,
390390
bx: &Bx,

src/librustc_codegen_llvm/mir/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ impl<'a, 'll: 'a, 'tcx: 'll, V : 'll + CodegenObject> PlaceRef<'tcx, V> {
395395
}
396396
}
397397

398-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx>
398+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx>
399399
where &'a Cx: LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
400400
{
401401
pub fn codegen_place<Bx: BuilderMethods<'a, 'll, 'tcx, CodegenCx=Cx>>(

src/librustc_codegen_llvm/mir/rvalue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use super::{FunctionCx, LocalRef};
2828
use super::operand::{OperandRef, OperandValue};
2929
use super::place::PlaceRef;
3030

31-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx>
31+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx>
3232
where &'a Cx: LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>> + HasTyCtxt<'tcx>
3333
{
3434
pub fn codegen_rvalue<Bx: BuilderMethods<'a, 'll, 'tcx, CodegenCx=Cx>>(
@@ -723,7 +723,7 @@ impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a,
723723
}
724724
}
725725

726-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx>
726+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: 'a + CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx>
727727
where &'a Cx : LayoutOf<Ty=Ty<'tcx>, TyLayout=TyLayout<'tcx>> + HasTyCtxt<'tcx>
728728
{
729729
pub fn rvalue_creates_operand(&self, rvalue: &mir::Rvalue<'tcx>) -> bool {

src/librustc_codegen_llvm/mir/statement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc::ty::layout::{TyLayout, HasTyCtxt, LayoutOf};
1818
use interfaces::*;
1919
use value::Value;
2020

21-
impl<'a, 'll: 'a, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'll, 'tcx, Cx>
21+
impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>> FunctionCx<'a, 'f, 'll, 'tcx, Cx>
2222
where &'a Cx: LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>> + HasTyCtxt<'tcx>
2323
{
2424
pub fn codegen_statement<Bx: BuilderMethods<'a, 'll, 'tcx, CodegenCx=Cx>>(

0 commit comments

Comments
 (0)