[llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 12 15:14:18 PDT 2005
Changes in directory llvm/lib/VMCore:
BasicBlock.cpp updated: 1.67 -> 1.68
---
Log message:
Add a helper method
---
Diffs of the changes: (+8 -0)
BasicBlock.cpp | 8 ++++++++
1 files changed, 8 insertions(+)
Index: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.67 llvm/lib/VMCore/BasicBlock.cpp:1.68
--- llvm/lib/VMCore/BasicBlock.cpp:1.67 Fri Aug 5 10:34:10 2005
+++ llvm/lib/VMCore/BasicBlock.cpp Fri Aug 12 17:14:06 2005
@@ -102,6 +102,14 @@
getParent()->getBasicBlockList().erase(this);
}
+/// moveBefore - Unlink this instruction from its current function and
+/// insert it into the function that MovePos lives in, right before
+/// MovePos.
+void BasicBlock::moveBefore(BasicBlock *MovePos) {
+ MovePos->getParent()->getBasicBlockList().splice(MovePos,
+ getParent()->getBasicBlockList(), this);
+}
+
TerminatorInst *BasicBlock::getTerminator() {
if (InstList.empty()) return 0;
More information about the llvm-commits
mailing list