From b2b7ef1de8118095963e1c085467fc411bd7e56f Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 24 Aug 2015 22:59:52 +0000 Subject: MachineBasicBlock: Add liveins() method returning an iterator_range llvm-svn: 245895 --- llvm/lib/CodeGen/TailDuplication.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/TailDuplication.cpp') diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index fc29eafb521..ca929d9fa45 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -791,13 +791,12 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, RS->enterBasicBlock(PredBB); if (!PredBB->empty()) RS->forward(std::prev(PredBB->end())); - for (MachineBasicBlock::livein_iterator I = TailBB->livein_begin(), - E = TailBB->livein_end(); I != E; ++I) { - if (!RS->isRegUsed(*I, false)) + for (unsigned LI : TailBB->liveins()) { + if (!RS->isRegUsed(LI, false)) // If a register is previously livein to the tail but it's not live // at the end of predecessor BB, then it should be added to its // livein list. - PredBB->addLiveIn(*I); + PredBB->addLiveIn(LI); } } -- cgit v1.2.3