mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-17 18:24:34 +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:
@@ -434,6 +434,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
// If there is a return value, scavenge the result from the location the call
|
// If there is a return value, scavenge the result from the location the call
|
||||||
// leaves it in...
|
// leaves it in...
|
||||||
//
|
//
|
||||||
|
if (CI.getType() != Type::VoidTy) {
|
||||||
switch (getClass(CI.getType())) {
|
switch (getClass(CI.getType())) {
|
||||||
case cInt:
|
case cInt:
|
||||||
BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
|
BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
|
||||||
@@ -444,6 +445,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
<< *CI.getType() << "'\n";
|
<< *CI.getType() << "'\n";
|
||||||
visitInstruction(CI);
|
visitInstruction(CI);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// visitSimpleBinary - Implement simple binary operators for integral types...
|
/// visitSimpleBinary - Implement simple binary operators for integral types...
|
||||||
|
@@ -434,6 +434,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
// If there is a return value, scavenge the result from the location the call
|
// If there is a return value, scavenge the result from the location the call
|
||||||
// leaves it in...
|
// leaves it in...
|
||||||
//
|
//
|
||||||
|
if (CI.getType() != Type::VoidTy) {
|
||||||
switch (getClass(CI.getType())) {
|
switch (getClass(CI.getType())) {
|
||||||
case cInt:
|
case cInt:
|
||||||
BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
|
BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
|
||||||
@@ -444,6 +445,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
<< *CI.getType() << "'\n";
|
<< *CI.getType() << "'\n";
|
||||||
visitInstruction(CI);
|
visitInstruction(CI);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// visitSimpleBinary - Implement simple binary operators for integral types...
|
/// visitSimpleBinary - Implement simple binary operators for integral types...
|
||||||
|
Reference in New Issue
Block a user