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
This commit is contained in:
John McCall 2011-01-14 10:35:38 +00:00
parent 8d7716a220
commit 5461a7523f
1 changed files with 4 additions and 0 deletions

View File

@ -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();