summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-31 19:24:41 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-31 19:24:41 +0000
commit62c979ba07abdb682c1366157574f5dc87b29584 (patch)
treeb13e3bc58a7d0fd06534cc3d69761e4814fcae8f /llvm/lib/CodeGen/BranchFolding.cpp
parent0f1c2ed907a51efb57280e59ea5ef70904ebd07c (diff)
downloadbcm5719-llvm-62c979ba07abdb682c1366157574f5dc87b29584.tar.gz
bcm5719-llvm-62c979ba07abdb682c1366157574f5dc87b29584.zip
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. llvm-svn: 15376
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index a82cad27674..0a6bd39ee6a 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/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()) {
OpenPOWER on IntegriCloud