mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
a324364f04
commit
4fa1acc945
@ -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;
|
||||
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);
|
||||
default:
|
||||
std::cerr << "Cannot get return value for call of type '"
|
||||
<< *CI.getType() << "'\n";
|
||||
visitInstruction(CI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
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);
|
||||
default:
|
||||
std::cerr << "Cannot get return value for call of type '"
|
||||
<< *CI.getType() << "'\n";
|
||||
visitInstruction(CI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user