summaryrefslogtreecommitdiffstats
path: root/clang/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
commit5461a7523f4d92f9fa8ebfc95a708ac64a8a97fc (patch)
tree40c5f5572882406a65b79004d8b4fd66c5641aeb /clang/lib/CodeGen/CodeGenFunction.cpp
parent8d7716a220f2b57c497c5488a9d1bd7ea4d8a5bc (diff)
downloadbcm5719-llvm-5461a7523f4d92f9fa8ebfc95a708ac64a8a97fc.tar.gz
bcm5719-llvm-5461a7523f4d92f9fa8ebfc95a708ac64a8a97fc.zip
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. llvm-svn: 123438
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 281a62f899a..76698464c24 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud