aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 22:58:35 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 22:58:35 +0000
commitdc0848c0293d798fecd4d02273cf98e84dc95866 (patch)
treedc64f6a8e3754c45b452e5972576f429d84dd23d /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parente1fd99c197ede469c25d2c25e24397130a0a48f3 (diff)
downloadllvm-dc0848c0293d798fecd4d02273cf98e84dc95866.zip
llvm-dc0848c0293d798fecd4d02273cf98e84dc95866.tar.gz
llvm-dc0848c0293d798fecd4d02273cf98e84dc95866.tar.bz2
CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC
Delete MachineInstr::getIterator(), since the term "iterator" is overloaded when talking about MachineInstr. - Downcast to ilist_node in iplist::getNextNode() and getPrevNode() so that ilist_node::getIterator() is still available. - Add it back as MachineInstr::getInstrIterator(). This matches the naming in MachineBasicBlock. - Add MachineInstr::getBundleIterator(). This is explicitly called "bundle" (not matching MachineBasicBlock) to disintinguish it clearly from ilist_node::getIterator(). - Update all calls. Some of these I switched to `auto` to remove boiler-plate, since the new name is clear about the type. There was one call I updated that looked fishy, but it wasn't clear what the right answer was. This was in X86FrameLowering::inlineStackProbe(), added in r252578 in lib/Target/X86/X86FrameLowering.cpp. I opted to leave the behaviour unchanged, but I'll reply to the original commit on the list in a moment. llvm-svn: 261504
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 79240b3..aef5db9 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -90,8 +90,10 @@ static bool NoInterveningSideEffect(const MachineInstr *CopyMI,
if (MI->getParent() != MBB)
return false;
- for (MachineBasicBlock::const_iterator I = std::next(CopyMI->getIterator()),
- E = MBB->end(), E2 = MI->getIterator(); I != E && I != E2; ++I) {
+ for (MachineBasicBlock::const_instr_iterator
+ I = std::next(CopyMI->getInstrIterator()),
+ E = MBB->instr_end(), E2 = MI->getInstrIterator();
+ I != E && I != E2; ++I) {
if (I->hasUnmodeledSideEffects() || I->isCall() ||
I->isTerminator())
return false;
@@ -163,8 +165,8 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
// Clear any kills of Def between CopyMI and MI. This extends the
// live range.
- for (MachineInstr &MMI
- : make_range(CopyMI->getIterator(), MI->getIterator()))
+ for (MachineInstr &MMI :
+ make_range(CopyMI->getInstrIterator(), MI->getInstrIterator()))
MMI.clearRegisterKills(Def, TRI);
MI->eraseFromParent();