diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-03 20:19:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-03 20:19:23 +0000 |
commit | f28bbda2c6c965dbd28e73e06c9e09231a77b0dc (patch) | |
tree | 3ecfa4454de33b2093bad258ef604d077e3b805d /lib/CodeGen/MachineFunction.cpp | |
parent | ee773ba72b372460429431ee094690da2464082b (diff) |
Bugfixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 21f41b95b0..205414e726 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -25,9 +25,10 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/Support/LeakDetector.h" -#include "llvm/Support/GraphWriter.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/GraphWriter.h" +#include "llvm/Support/LeakDetector.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Config/config.h" #include <fstream> #include <iostream> @@ -148,11 +149,8 @@ void MachineFunction::RenumberBlocks(MachineBasicBlock *MBB) { // Figure out the block number this should have. unsigned BlockNo = 0; - if (MBB != &front()) { - MachineFunction::iterator I = MBB; - --I; - BlockNo = I->getNumber()+1; - } + if (MBBI != begin()) + BlockNo = prior(MBBI)->getNumber()+1; for (; MBBI != E; ++MBBI, ++BlockNo) { if (MBBI->getNumber() != (int)BlockNo) { |