aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-01-14 10:35:38 +0000
committerJohn McCall <rjmccall@apple.com>2011-01-14 10:35:38 +0000
commitb8424370ff7ebb63db04b2398ddaa92e829582a4 (patch)
tree616b25f9326abd2239b847a7a577317f4c8ae980 /lib/CodeGen/CodeGenFunction.cpp
parent161e40c150e1629fe2861bcfc82ea0dffc00b72f (diff)
When simplifying a cleanup's entry by merging it into a single predecessor,
replace all uses of the entry with the predecessor. There are no cleanups relying on this right now, but if we ever want a cleanup with a phi inside it, this will be important. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 281a62f899..76698464c2 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -754,6 +754,10 @@ static llvm::BasicBlock *SimplifyCleanupEntry(CodeGenFunction &CGF,
// Merge the blocks.
Pred->getInstList().splice(Pred->end(), Entry->getInstList());
+ // Replace all uses of the entry with the predecessor, in case there
+ // are phis in the cleanup.
+ Entry->replaceAllUsesWith(Pred);
+
// Kill the entry block.
Entry->eraseFromParent();