Skip to content

Commit

Permalink
rustc_codegen_ssa: clean up lifetimes on TerminatorCodegenHelper's me…
Browse files Browse the repository at this point in the history
…thods.
  • Loading branch information
eddyb committed Dec 3, 2019
1 parent fce40a2 commit 6a75768
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/librustc_codegen_ssa/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@ struct TerminatorCodegenHelper<'tcx> {
funclet_bb: Option<mir::BasicBlock>,
}

// FIXME(eddyb) clean up the lifetimes in this impl.
impl<'tcx> TerminatorCodegenHelper<'tcx> {
impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
/// Returns the associated funclet from `FunctionCx::funclets` for the
/// `funclet_bb` member if it is not `None`.
fn funclet<'c, 'b, Bx: BuilderMethods<'b, 'tcx>>(
fn funclet<'b, Bx: BuilderMethods<'a, 'tcx>>(
&self,
fx: &'c mut FunctionCx<'b, 'tcx, Bx>,
) -> Option<&'c Bx::Funclet> {
fx: &'b mut FunctionCx<'a, 'tcx, Bx>,
) -> Option<&'b Bx::Funclet> {
match self.funclet_bb {
Some(funcl) => fx.funclets[funcl].as_ref(),
None => None,
}
}

fn lltarget<'b, 'c, Bx: BuilderMethods<'b, 'tcx>>(
fn lltarget<Bx: BuilderMethods<'a, 'tcx>>(
&self,
fx: &'c mut FunctionCx<'b, 'tcx, Bx>,
fx: &mut FunctionCx<'a, 'tcx, Bx>,
target: mir::BasicBlock,
) -> (Bx::BasicBlock, bool) {
let span = self.terminator.source_info.span;
Expand All @@ -64,9 +63,9 @@ impl<'tcx> TerminatorCodegenHelper<'tcx> {
}

/// Create a basic block.
fn llblock<'c, 'b, Bx: BuilderMethods<'b, 'tcx>>(
fn llblock<Bx: BuilderMethods<'a, 'tcx>>(
&self,
fx: &'c mut FunctionCx<'b, 'tcx, Bx>,
fx: &mut FunctionCx<'a, 'tcx, Bx>,
target: mir::BasicBlock,
) -> Bx::BasicBlock {
let (lltarget, is_cleanupret) = self.lltarget(fx, target);
Expand All @@ -84,9 +83,9 @@ impl<'tcx> TerminatorCodegenHelper<'tcx> {
}
}

fn funclet_br<'c, 'b, Bx: BuilderMethods<'b, 'tcx>>(
fn funclet_br<Bx: BuilderMethods<'a, 'tcx>>(
&self,
fx: &'c mut FunctionCx<'b, 'tcx, Bx>,
fx: &mut FunctionCx<'a, 'tcx, Bx>,
bx: &mut Bx,
target: mir::BasicBlock,
) {
Expand All @@ -102,9 +101,9 @@ impl<'tcx> TerminatorCodegenHelper<'tcx> {

/// Call `fn_ptr` of `fn_abi` with the arguments `llargs`, the optional
/// return destination `destination` and the cleanup function `cleanup`.
fn do_call<'c, 'b, Bx: BuilderMethods<'b, 'tcx>>(
fn do_call<Bx: BuilderMethods<'a, 'tcx>>(
&self,
fx: &'c mut FunctionCx<'b, 'tcx, Bx>,
fx: &mut FunctionCx<'a, 'tcx, Bx>,
bx: &mut Bx,
fn_abi: FnAbi<'tcx, Ty<'tcx>>,
fn_ptr: Bx::Value,
Expand Down Expand Up @@ -152,7 +151,7 @@ impl<'tcx> TerminatorCodegenHelper<'tcx> {

// Generate sideeffect intrinsic if jumping to any of the targets can form
// a loop.
fn maybe_sideeffect<'b, Bx: BuilderMethods<'b, 'tcx>>(
fn maybe_sideeffect<Bx: BuilderMethods<'a, 'tcx>>(
&self,
mir: mir::ReadOnlyBodyCache<'tcx, 'tcx>,
bx: &mut Bx,
Expand Down

0 comments on commit 6a75768

Please sign in to comment.