// to set, the condition code register to branch on, the true/false values to
// select between, and a branch opcode to use.
const BasicBlock *LLVM_BB = BB->getBasicBlock();
- MachineFunction::iterator It = BB;
- ++It;
+ MachineFunction::iterator It = ++BB->getIterator();
// thisMBB:
// ...
// Find thread local globals.
bool MadeChange = false;
SmallVector<GlobalVariable *, 16> ThreadLocalGlobals;
- for (Module::global_iterator GVI = M.global_begin(), E = M.global_end();
- GVI != E; ++GVI) {
- GlobalVariable *GV = GVI;
- if (GV->isThreadLocal())
- ThreadLocalGlobals.push_back(GV);
- }
+ for (GlobalVariable &GV : M.globals())
+ if (GV.isThreadLocal())
+ ThreadLocalGlobals.push_back(&GV);
for (unsigned I = 0, E = ThreadLocalGlobals.size(); I != E; ++I) {
MadeChange |= lowerGlobal(ThreadLocalGlobals[I]);
}