Fix build with stdcxx by using llvm::next. Patch by Joerg Sonnenberger!
authorNick Lewycky <nicholas@mxc.ca>
Fri, 28 Jan 2011 04:00:15 +0000 (04:00 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 28 Jan 2011 04:00:15 +0000 (04:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124472 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 48a2dc58da28384fa4a2ff6a9ba644389b56f172..7c49c2235821b7b639cff9bb15c6c633350ae070 100644 (file)
@@ -2261,7 +2261,8 @@ size_t SelectionDAGBuilder::Clusterify(CaseVector& Cases,
   if (Cases.size() >= 2)
     // Must recompute end() each iteration because it may be
     // invalidated by erase if we hold on to it
-    for (CaseItr I = Cases.begin(), J = ++(Cases.begin()); J != Cases.end(); ) {
+    for (CaseItr I = Cases.begin(), J = llvm::next(Cases.begin());
+         J != Cases.end(); ) {
       const APInt& nextValue = cast<ConstantInt>(J->Low)->getValue();
       const APInt& currentValue = cast<ConstantInt>(I->High)->getValue();
       MachineBasicBlock* nextBB = J->BB;