forked from OSchip/llvm-project
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:
parent
8d7716a220
commit
5461a7523f
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue