diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-07-31 19:24:41 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-07-31 19:24:41 +0000 |
commit | f978a1db517749e91210b7df17b7f11b9a30ae47 (patch) | |
tree | 07470bc375cff6cd82589353bde8d2e46e93ce96 /lib/CodeGen/BranchFolding.cpp | |
parent | 7f74340733967255cf45f6514cf0f18a1f325371 (diff) |
Make OptimizeBlock take a MachineFunction::iterator instead of a
MachineBasicBlock* as a parameter so that nxext() and prior() helper
functions can work naturally on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index a82cad2767..0a6bd39ee6 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -28,8 +28,8 @@ namespace { virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Branch Folder"; } private: - bool OptimizeBlock(MachineBasicBlock *MBB, const TargetInstrInfo &TII); - + bool OptimizeBlock(MachineFunction::iterator MBB, + const TargetInstrInfo &TII); bool isUncondBranch(const MachineInstr *MI, const TargetInstrInfo &TII) { return TII.isBarrier(MI->getOpcode()) && TII.isBranch(MI->getOpcode()); @@ -108,13 +108,13 @@ static void ReplaceUsesOfBlockWith(MachineBasicBlock *BB, } -bool BranchFolder::OptimizeBlock(MachineBasicBlock *MBB, +bool BranchFolder::OptimizeBlock(MachineFunction::iterator MBB, const TargetInstrInfo &TII) { // If this block is empty, make everyone use it's fall-through, not the block // explicitly. if (MBB->empty()) { if (MBB->pred_empty()) return false; - MachineFunction::iterator FallThrough =next(MachineFunction::iterator(MBB)); + MachineFunction::iterator FallThrough =next(MBB); assert(FallThrough != MBB->getParent()->end() && "Fell off the end of the function!"); while (!MBB->pred_empty()) { |