diff options
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r-- | lib/VMCore/BasicBlock.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 18a90d6b44..1b7100c68b 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/lib/VMCore/BasicBlock.cpp @@ -213,7 +213,8 @@ void BasicBlock::removePredecessor(BasicBlock *Pred, PN->removeIncomingValue(Pred, false); // If all incoming values to the Phi are the same, we can replace the Phi // with that value. - if (Value *PNV = PN->hasConstantValue()) { + Value* PNV = 0; + if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue())) { PN->replaceAllUsesWith(PNV); PN->eraseFromParent(); } |