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