diff options
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 20 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelSimple.cpp | 20 |
2 files changed, 22 insertions, 18 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); + } } } diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index 2f701ed8d3..1cfa0a56af 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.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); + } } } |