Index: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp =================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3861,9 +3861,9 @@ } // The landingpad is now unreachable. Zap it. - BB->eraseFromParent(); if (LoopHeaders) LoopHeaders->erase(BB); + BB->eraseFromParent(); return true; } @@ -4083,9 +4083,9 @@ // If we eliminated all predecessors of the block, delete the block now. if (pred_empty(BB)) { // We know there are no successors, so just nuke the block. - BB->eraseFromParent(); if (LoopHeaders) LoopHeaders->erase(BB); + BB->eraseFromParent(); } return true; @@ -4245,9 +4245,9 @@ // If this block is now dead, remove it. if (pred_empty(BB) && BB != &BB->getParent()->getEntryBlock()) { // We know there are no successors, so just nuke the block. - BB->eraseFromParent(); if (LoopHeaders) LoopHeaders->erase(BB); + BB->eraseFromParent(); return true; }