From 1446eedbc2f43e5421b2074caa73ff7f5d641272 Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Tue, 26 Sep 2017 01:37:53 +0000 Subject: [PATCH] [AVR] Prefer BasicBlock::getIterator over Function::begin() Thanks to Eli Friedman for the suggestion. llvm-svn: 314182 --- llvm/lib/Target/AVR/AVRISelLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AVR/AVRISelLowering.cpp b/llvm/lib/Target/AVR/AVRISelLowering.cpp index 50255f3ae676..890379d5639f 100644 --- a/llvm/lib/Target/AVR/AVRISelLowering.cpp +++ b/llvm/lib/Target/AVR/AVRISelLowering.cpp @@ -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.