[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sat Jul 31 12:24:51 PDT 2004
Changes in directory llvm/lib/CodeGen:
BranchFolding.cpp updated: 1.4 -> 1.5
---
Log message:
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.
---
Diffs of the changes: (+4 -4)
Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.4 llvm/lib/CodeGen/BranchFolding.cpp:1.5
--- llvm/lib/CodeGen/BranchFolding.cpp:1.4 Sat Jul 31 13:40:36 2004
+++ llvm/lib/CodeGen/BranchFolding.cpp Sat Jul 31 14:24:41 2004
@@ -28,8 +28,8 @@
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 @@
}
-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()) {
More information about the llvm-commits
mailing list