summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-01 01:43:03 +0000
committerChris Lattner <sabre@nondot.org>2009-04-01 01:43:03 +0000
commit647cffba610114b780059236b57aa78a3469197d (patch)
tree11dc99fe59b9600dd918870cd840d6e9895a1861 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentff5961b46c733dba039331d507414b786a31c9b8 (diff)
downloadbcm5719-llvm-647cffba610114b780059236b57aa78a3469197d.tar.gz
bcm5719-llvm-647cffba610114b780059236b57aa78a3469197d.zip
fix a serious regression I introduced in my previous patch.
llvm-svn: 68173
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index dfa215c2ed7..dd9db8f4366 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2067,7 +2067,8 @@ Module *BitcodeReader::materializeModule(std::string *ErrInfo) {
if (CallInst* CI = dyn_cast<CallInst>(*UI++))
UpgradeIntrinsicCall(CI, I->second);
}
- I->first->replaceAllUsesWith(I->second);
+ if (!I->first->use_empty())
+ I->first->replaceAllUsesWith(I->second);
I->first->eraseFromParent();
}
}
OpenPOWER on IntegriCloud