aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/InstSelectSimple.cpp
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
commit4fa1acc945e274c13e90b9080cf4c5001c3c521a (patch)
tree5683552c530c3bd16e17e56dc8a3653e16ddb068 /lib/Target/X86/InstSelectSimple.cpp
parenta324364f043e462562ef3e0e40459c526ef8bd0c (diff)
Fix handling of function calls that return void
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/InstSelectSimple.cpp')
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 2f701ed8d3..1cfa0a56af 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/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);
+ }
}
}