diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp b/contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp index c6914dcd0e54..23c511aaa056 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -134,9 +134,8 @@ void ilist_callback_traits<MachineBasicBlock>::addNodeToList( // Make sure the instructions have their operands in the reginfo lists. MachineRegisterInfo &RegInfo = MF.getRegInfo(); - for (MachineBasicBlock::instr_iterator - I = N->instr_begin(), E = N->instr_end(); I != E; ++I) - I->AddRegOperandsToUseLists(RegInfo); + for (MachineInstr &MI : N->instrs()) + MI.AddRegOperandsToUseLists(RegInfo); } void ilist_callback_traits<MachineBasicBlock>::removeNodeFromList( @@ -281,8 +280,8 @@ MachineBasicBlock::getLastNonDebugInstr(bool SkipPseudoOp) { } bool MachineBasicBlock::hasEHPadSuccessor() const { - for (const_succ_iterator I = succ_begin(), E = succ_end(); I != E; ++I) - if ((*I)->isEHPad()) + for (const MachineBasicBlock *Succ : successors()) + if (Succ->isEHPad()) return true; return false; } @@ -517,6 +516,11 @@ void MachineBasicBlock::printName(raw_ostream &os, unsigned printNameFlags, os << "landing-pad"; hasAttributes = true; } + if (isInlineAsmBrIndirectTarget()) { + os << (hasAttributes ? ", " : " ("); + os << "inlineasm-br-indirect-target"; + hasAttributes = true; + } if (isEHFuncletEntry()) { os << (hasAttributes ? ", " : " ("); os << "ehfunclet-entry"; @@ -1037,17 +1041,16 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( for (instr_iterator I = getFirstInstrTerminator(), E = instr_end(); I != E; ++I) { MachineInstr *MI = &*I; - for (MachineInstr::mop_iterator OI = MI->operands_begin(), - OE = MI->operands_end(); OI != OE; ++OI) { - if (!OI->isReg() || OI->getReg() == 0 || - !OI->isUse() || !OI->isKill() || OI->isUndef()) + for (MachineOperand &MO : MI->operands()) { + if (!MO.isReg() || MO.getReg() == 0 || !MO.isUse() || !MO.isKill() || + MO.isUndef()) continue; - Register Reg = OI->getReg(); + Register Reg = MO.getReg(); if (Register::isPhysicalRegister(Reg) || LV->getVarInfo(Reg).removeKill(*MI)) { KilledRegs.push_back(Reg); - LLVM_DEBUG(dbgs() << "Removing terminator kill: " << *MI); - OI->setIsKill(false); + LLVM_DEBUG(dbgs() << "Removing terminator kill: " << MI); + MO.setIsKill(false); } } } @@ -1058,12 +1061,11 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( I != E; ++I) { MachineInstr *MI = &*I; - for (MachineInstr::mop_iterator OI = MI->operands_begin(), - OE = MI->operands_end(); OI != OE; ++OI) { - if (!OI->isReg() || OI->getReg() == 0) + for (const MachineOperand &MO : MI->operands()) { + if (!MO.isReg() || MO.getReg() == 0) continue; - Register Reg = OI->getReg(); + Register Reg = MO.getReg(); if (!is_contained(UsedRegs, Reg)) UsedRegs.push_back(Reg); } |