]> granicus.if.org Git - clang/commitdiff
When simplifying a cleanup's entry by merging it into a single predecessor,
authorJohn McCall <rjmccall@apple.com>
Fri, 14 Jan 2011 10:35:38 +0000 (10:35 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 14 Jan 2011 10:35:38 +0000 (10:35 +0000)
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

lib/CodeGen/CodeGenFunction.cpp

index 281a62f899a23683c8ad84ff4e7bfc649186b76a..76698464c24bd376d6465f51499281e450bc67f7 100644 (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();