Next on a pointer increments the pointer, not an iterator
llvm-svn: 15375
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index ef28c95..a82cad2 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -114,7 +114,7 @@
// explicitly.
if (MBB->empty()) {
if (MBB->pred_empty()) return false;
- MachineFunction::iterator FallThrough = next(MBB);
+ MachineFunction::iterator FallThrough =next(MachineFunction::iterator(MBB));
assert(FallThrough != MBB->getParent()->end() &&
"Fell off the end of the function!");
while (!MBB->pred_empty()) {