aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-13 22:59:11 +0000
committerDevang Patel <dpatel@apple.com>2009-10-13 22:59:11 +0000
commit9c0957069f3a92c5ee1e3da630ef360eca5b2061 (patch)
tree79f85eb624273836f3c098c659985e560f7b10f3 /lib/CodeGen/CodeGenModule.cpp
parentde699e551062f2b20e66decd4de87ee0804b67cc (diff)
Check void type before using replaceAllUsesWith().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index d84a397a7f..d091157f87 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -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();
}