diff options
| author | Dan Gohman <gohman@apple.com> | 2009-10-30 02:13:27 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-10-30 02:13:27 +0000 |
| commit | 64997909a6b4ea4153b834e40a35a9a2bb1da74a (patch) | |
| tree | 158f2cea69b6c4867971c92a9ac2f2f185f7109c /llvm/lib/CodeGen | |
| parent | e0a8b8fc564a69ded8bd31fa9be5dd7aa0942703 (diff) | |
| download | bcm5719-llvm-64997909a6b4ea4153b834e40a35a9a2bb1da74a.tar.gz bcm5719-llvm-64997909a6b4ea4153b834e40a35a9a2bb1da74a.zip | |
Don't delete blocks which have their address taken.
llvm-svn: 85572
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index 9746fb3ea2e..455da1ad11b 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -881,8 +881,9 @@ bool BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) { // If this block is empty, make everyone use its fall-through, not the block // explicitly. Landing pads should not do this since the landing-pad table - // points to this block. - if (MBB->empty() && !MBB->isLandingPad()) { + // points to this block. Blocks with their addresses taken shouldn't be + // optimized away. + if (MBB->empty() && !MBB->isLandingPad() && !MBB->hasAddressTaken()) { // Dead block? Leave for cleanup later. if (MBB->pred_empty()) return MadeChange; |

