diff options
author | John McCall <rjmccall@apple.com> | 2011-01-14 10:35:38 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-14 10:35:38 +0000 |
commit | 5461a7523f4d92f9fa8ebfc95a708ac64a8a97fc (patch) | |
tree | 40c5f5572882406a65b79004d8b4fd66c5641aeb /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 8d7716a220f2b57c497c5488a9d1bd7ea4d8a5bc (diff) | |
download | bcm5719-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.cpp | 4 |
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(); |