summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodePlacementOpt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-03 00:50:42 +0000
committerChris Lattner <sabre@nondot.org>2009-12-03 00:50:42 +0000
commita48f44d9ee15b2d9f696c5de6f3e60dc84639c0f (patch)
tree37f783e993984e7b0fdd0a0693a337c59f5d3b04 /llvm/lib/CodeGen/CodePlacementOpt.cpp
parentf66b72094a9d537a2ec15e6c4d2871b8f58c9aea (diff)
downloadbcm5719-llvm-a48f44d9ee15b2d9f696c5de6f3e60dc84639c0f.tar.gz
bcm5719-llvm-a48f44d9ee15b2d9f696c5de6f3e60dc84639c0f.zip
improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant! llvm-svn: 90365
Diffstat (limited to 'llvm/lib/CodeGen/CodePlacementOpt.cpp')
-rw-r--r--llvm/lib/CodeGen/CodePlacementOpt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodePlacementOpt.cpp b/llvm/lib/CodeGen/CodePlacementOpt.cpp
index e9844d84c17..ff71f6b8067 100644
--- a/llvm/lib/CodeGen/CodePlacementOpt.cpp
+++ b/llvm/lib/CodeGen/CodePlacementOpt.cpp
@@ -182,7 +182,7 @@ bool CodePlacementOpt::EliminateUnconditionalJumpsToTop(MachineFunction &MF,
// Move it and all the blocks that can reach it via fallthrough edges
// exclusively, to keep existing fallthrough edges intact.
MachineFunction::iterator Begin = Pred;
- MachineFunction::iterator End = next(Begin);
+ MachineFunction::iterator End = llvm::next(Begin);
while (Begin != MF.begin()) {
MachineFunction::iterator Prior = prior(Begin);
if (Prior == MF.begin())
@@ -255,7 +255,8 @@ bool CodePlacementOpt::MoveDiscontiguousLoopBlocks(MachineFunction &MF,
// to the top of the loop to avoid loosing that fallthrough. Otherwise append
// them to the bottom, even if it previously had a fallthrough, on the theory
// that it's worth an extra branch to keep the loop contiguous.
- MachineFunction::iterator InsertPt = next(MachineFunction::iterator(BotMBB));
+ MachineFunction::iterator InsertPt =
+ llvm::next(MachineFunction::iterator(BotMBB));
bool InsertAtTop = false;
if (TopMBB != MF.begin() &&
!HasFallthrough(prior(MachineFunction::iterator(TopMBB))) &&
@@ -268,7 +269,7 @@ bool CodePlacementOpt::MoveDiscontiguousLoopBlocks(MachineFunction &MF,
// with the loop header.
SmallPtrSet<MachineBasicBlock *, 8> ContiguousBlocks;
for (MachineFunction::iterator I = TopMBB,
- E = next(MachineFunction::iterator(BotMBB)); I != E; ++I)
+ E = llvm::next(MachineFunction::iterator(BotMBB)); I != E; ++I)
ContiguousBlocks.insert(I);
// Find non-contigous blocks and fix them.
@@ -301,7 +302,7 @@ bool CodePlacementOpt::MoveDiscontiguousLoopBlocks(MachineFunction &MF,
// Process this block and all loop blocks contiguous with it, to keep
// them in their relative order.
MachineFunction::iterator Begin = BB;
- MachineFunction::iterator End = next(MachineFunction::iterator(BB));
+ MachineFunction::iterator End = llvm::next(MachineFunction::iterator(BB));
for (; End != MF.end(); ++End) {
if (!L->contains(End)) break;
if (!HasAnalyzableTerminator(End)) break;
OpenPOWER on IntegriCloud