diff options
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 281a62f899..76698464c2 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -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(); |