[cfe-commits] r123438 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

John McCall rjmccall at apple.com
Fri Jan 14 02:35:38 PST 2011

Author: rjmccall
Date: Fri Jan 14 04:35:38 2011
New Revision: 123438

URL: http://llvm.org/viewvc/llvm-project?rev=123438&view=rev
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.


Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=123438&r1=123437&r2=123438&view=diff
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Jan 14 04:35:38 2011
@@ -754,6 +754,10 @@
   // 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.

More information about the cfe-commits mailing list