Skip to content

Commit

Permalink
[AVR] Prefer BasicBlock::getIterator over Function::begin()
Browse files Browse the repository at this point in the history
Thanks to Eli Friedman for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314182 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dylanmckay committed Sep 26, 2017
1 parent fca6e8b commit c35197f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Target/AVR/AVRISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ MachineBasicBlock *AVRTargetLowering::insertShift(MachineInstr &MI,
const BasicBlock *LLVM_BB = BB->getBasicBlock();

MachineFunction::iterator I;
for (I = F->begin(); I != F->end() && &(*I) != BB; ++I);
for (I = BB->getIterator(); I != F->end() && &(*I) != BB; ++I);
if (I != F->end()) ++I;

// Create loop block.
Expand Down

0 comments on commit c35197f

Please sign in to comment.