Check void type before using replaceAllUsesWith().

llvm-svn: 84050
This commit is contained in:
Devang Patel 2009-10-13 22:59:11 +00:00
parent a677136900
commit 3b3f0f6b65
1 changed files with 2 additions and 1 deletions

View File

@ -1110,7 +1110,8 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
NewCall->setCallingConv(CI->getCallingConv());
// Finally, remove the old call, replacing any uses with the new one.
CI->replaceAllUsesWith(NewCall);
if (CI->getType() != llvm::Type::getVoidTy(CI->getContext()))
CI->replaceAllUsesWith(NewCall);
CI->eraseFromParent();
}