summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-06-23 09:09:15 +0000
committerJay Foad <jay.foad@gmail.com>2011-06-23 09:09:15 +0000
commit61ea0e469254e0c7ab0e190b463d994b9316846c (patch)
tree4a3a7f1235a5366dc6d5c41a4edf7b8b86b15b87 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent25fbb92320fac0a9982d03cc1b00973440d4d475 (diff)
downloadbcm5719-llvm-61ea0e469254e0c7ab0e190b463d994b9316846c.tar.gz
bcm5719-llvm-61ea0e469254e0c7ab0e190b463d994b9316846c.zip
Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 92464e8cf13..b4f74f97e97 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -153,13 +153,13 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) {
// Delete the unconditional branch from the predecessor...
PredBB->getInstList().pop_back();
- // Move all definitions in the successor to the predecessor...
- PredBB->getInstList().splice(PredBB->end(), BB->getInstList());
-
// Make all PHI nodes that referred to BB now refer to Pred as their
// source...
BB->replaceAllUsesWith(PredBB);
+ // Move all definitions in the successor to the predecessor...
+ PredBB->getInstList().splice(PredBB->end(), BB->getInstList());
+
// Inherit predecessors name if it exists.
if (!PredBB->hasName())
PredBB->takeName(BB);
OpenPOWER on IntegriCloud