aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-08 19:11:57 +0000
committerChris Lattner <sabre@nondot.org>2005-08-08 19:11:57 +0000
commit4bc5f8071a28b6fc4f4c2207dd03a5f747d0d84b (patch)
tree79609c739e34f77a2e9edaa1c515b8796781ff20 /lib/Transforms/Scalar/Reassociate.cpp
parentde0132453e2939488c2d69290bfdfb2cde94a0af (diff)
Use the new 'moveBefore' method to simplify some code. Really, which is
easier to understand? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 1bc6ebe489..c55bce0d7e 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -184,7 +184,7 @@ void Reassociate::LinearizeExpr(BinaryOperator *I) {
// Move the RHS instruction to live immediately before I, avoiding breaking
// dominator properties.
- I->getParent()->getInstList().splice(I, RHS->getParent()->getInstList(), RHS);
+ RHS->moveBefore(I);
// Move operands around to do the linearization.
I->setOperand(1, RHS->getOperand(0));
@@ -261,8 +261,7 @@ void Reassociate::LinearizeExprTree(BinaryOperator *I,
// Move LHS right before I to make sure that the tree expression dominates all
// values.
- I->getParent()->getInstList().splice(I,
- LHSBO->getParent()->getInstList(), LHSBO);
+ LHSBO->moveBefore(I);
// Linearize the expression tree on the LHS.
LinearizeExprTree(LHSBO, Ops);