From: Chris Lattner Date: Wed, 1 Apr 2009 01:43:03 +0000 (+0000) Subject: fix a serious regression I introduced in my previous patch. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7d9eb5884c34d0b6d9912d1f972327eedc62d60a;p=oota-llvm.git 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 --- diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index dfa215c2ed7..dd9db8f4366 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(*UI++)) UpgradeIntrinsicCall(CI, I->second); } - I->first->replaceAllUsesWith(I->second); + if (!I->first->use_empty()) + I->first->replaceAllUsesWith(I->second); I->first->eraseFromParent(); } }