summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-04 23:50:28 +0000
committerChris Lattner <sabre@nondot.org>2002-12-04 23:50:28 +0000
commite21336000b7f5c0eed0670399cb4d2163d66e5f0 (patch)
tree5e0b68e58fac247e02059579c33f994a72900067 /llvm/lib
parent4859c65d48290ddb543f67aa143e7bc081de54d4 (diff)
downloadbcm5719-llvm-e21336000b7f5c0eed0670399cb4d2163d66e5f0.tar.gz
bcm5719-llvm-e21336000b7f5c0eed0670399cb4d2163d66e5f0.zip
Fix handling of function calls that return void
llvm-svn: 4925
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp
index 2f701ed8d3d..1cfa0a56af3 100644
--- a/llvm/lib/Target/X86/InstSelectSimple.cpp
+++ b/llvm/lib/Target/X86/InstSelectSimple.cpp
@@ -434,15 +434,17 @@ ISel::visitCallInst (CallInst & CI)
// If there is a return value, scavenge the result from the location the call
// leaves it in...
//
- switch (getClass(CI.getType())) {
- case cInt:
- BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
- break;
-
- default:
- std::cerr << "Cannot get return value for call of type '"
- << *CI.getType() << "'\n";
- visitInstruction(CI);
+ if (CI.getType() != Type::VoidTy) {
+ switch (getClass(CI.getType())) {
+ case cInt:
+ BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
+ break;
+
+ default:
+ std::cerr << "Cannot get return value for call of type '"
+ << *CI.getType() << "'\n";
+ visitInstruction(CI);
+ }
}
}
OpenPOWER on IntegriCloud