aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
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
commit7d9eb5884c34d0b6d9912d1f972327eedc62d60a (patch)
tree678f6fdbb843291712f45ebdd61b9e4b164b30a8 /lib/Bitcode
parentf41fcbb60d909ebae0e31300322b94922c1ee886 (diff)
downloadexternal_llvm-7d9eb5884c34d0b6d9912d1f972327eedc62d60a.zip
external_llvm-7d9eb5884c34d0b6d9912d1f972327eedc62d60a.tar.gz
external_llvm-7d9eb5884c34d0b6d9912d1f972327eedc62d60a.tar.bz2
fix a serious regression I introduced in my previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index dfa215c..dd9db8f 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/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();
}
}