[llvm-commits] CVS: llvm/lib/CodeGen/MachineBasicBlock.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 23 17:02:40 PDT 2006
Changes in directory llvm/lib/CodeGen:
MachineBasicBlock.cpp updated: 1.32 -> 1.33
---
Log message:
add moveBefore/moveAfter helper methods
---
Diffs of the changes: (+12 -0)
MachineBasicBlock.cpp | 12 ++++++++++++
1 files changed, 12 insertions(+)
Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.32 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.33
--- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.32 Fri Oct 6 16:28:17 2006
+++ llvm/lib/CodeGen/MachineBasicBlock.cpp Mon Oct 23 19:02:26 2006
@@ -120,6 +120,18 @@
}
}
+void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) {
+ MachineFunction::BasicBlockListType &BBList =getParent()->getBasicBlockList();
+ getParent()->getBasicBlockList().splice(NewAfter, BBList, this);
+}
+
+void MachineBasicBlock::moveAfter(MachineBasicBlock *NewBefore) {
+ MachineFunction::BasicBlockListType &BBList =getParent()->getBasicBlockList();
+ MachineFunction::iterator BBI = NewBefore;
+ getParent()->getBasicBlockList().splice(++BBI, BBList, this);
+}
+
+
void MachineBasicBlock::addSuccessor(MachineBasicBlock *succ) {
Successors.push_back(succ);
succ->addPredecessor(this);
More information about the llvm-commits
mailing list