mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Fix instsel for calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac676bef50
commit
d852c15546
@ -389,10 +389,9 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
{
|
{
|
||||||
// Push the arguments on the stack in reverse order, as specified by
|
// Push the arguments on the stack in reverse order, as specified by
|
||||||
// the ABI.
|
// the ABI.
|
||||||
for (unsigned i = CI.getNumOperands (); i >= 1; --i)
|
for (unsigned i = CI.getNumOperands()-1; i >= 1; --i)
|
||||||
{
|
{
|
||||||
Value *v = CI.getOperand (i);
|
Value *v = CI.getOperand (i);
|
||||||
unsigned argReg = getReg (v);
|
|
||||||
switch (getClass (v->getType ()))
|
switch (getClass (v->getType ()))
|
||||||
{
|
{
|
||||||
case cByte:
|
case cByte:
|
||||||
@ -404,7 +403,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
break;
|
break;
|
||||||
case cInt:
|
case cInt:
|
||||||
case cFloat:
|
case cFloat:
|
||||||
BuildMI (BB, X86::PUSHr32, 1).addReg (argReg);
|
BuildMI (BB, X86::PUSHr32, 1).addReg(getReg(v));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// FIXME: long/ulong/double args not handled.
|
// FIXME: long/ulong/double args not handled.
|
||||||
|
@ -389,10 +389,9 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
{
|
{
|
||||||
// Push the arguments on the stack in reverse order, as specified by
|
// Push the arguments on the stack in reverse order, as specified by
|
||||||
// the ABI.
|
// the ABI.
|
||||||
for (unsigned i = CI.getNumOperands (); i >= 1; --i)
|
for (unsigned i = CI.getNumOperands()-1; i >= 1; --i)
|
||||||
{
|
{
|
||||||
Value *v = CI.getOperand (i);
|
Value *v = CI.getOperand (i);
|
||||||
unsigned argReg = getReg (v);
|
|
||||||
switch (getClass (v->getType ()))
|
switch (getClass (v->getType ()))
|
||||||
{
|
{
|
||||||
case cByte:
|
case cByte:
|
||||||
@ -404,7 +403,7 @@ ISel::visitCallInst (CallInst & CI)
|
|||||||
break;
|
break;
|
||||||
case cInt:
|
case cInt:
|
||||||
case cFloat:
|
case cFloat:
|
||||||
BuildMI (BB, X86::PUSHr32, 1).addReg (argReg);
|
BuildMI (BB, X86::PUSHr32, 1).addReg(getReg(v));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// FIXME: long/ulong/double args not handled.
|
// FIXME: long/ulong/double args not handled.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user