summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-31 19:36:47 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-31 19:36:47 +0000
commitca9a4f10455321b78ea9e275c4a04584a5f2c739 (patch)
treeb5d258207a0104300c8fd140aab22637c5141c08 /llvm/lib/Transforms/Scalar/TailDuplication.cpp
parent01ea674c5bcbeb8ba6233dea3e13bccca66eb69d (diff)
downloadbcm5719-llvm-ca9a4f10455321b78ea9e275c4a04584a5f2c739.tar.gz
bcm5719-llvm-ca9a4f10455321b78ea9e275c4a04584a5f2c739.zip
PR4662: Fix a crash introduced by the recent LLVMContext changes.
llvm-svn: 77716
Diffstat (limited to 'llvm/lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/TailDuplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
index dccc3e6ffb3..5e54a69bfa1 100644
--- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
@@ -360,7 +360,8 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
Instruction *Inst = BI++;
if (isInstructionTriviallyDead(Inst))
Inst->eraseFromParent();
- else if (Constant *C = ConstantFoldInstruction(Inst, BI->getContext())) {
+ else if (Constant *C = ConstantFoldInstruction(Inst,
+ Inst->getContext())) {
Inst->replaceAllUsesWith(C);
Inst->eraseFromParent();
}
OpenPOWER on IntegriCloud