Skip to content

Commit

Permalink
Fixed more problems caused by 78142.
Browse files Browse the repository at this point in the history
Passing of indirect arguments starts after return value on the callee's frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78635 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Sanjiv Gupta committed Aug 11, 2009
1 parent 3a5f0d4 commit a418628
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Target/PIC16/PIC16ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ PIC16TargetLowering::MakePIC16Libcall(PIC16ISD::PIC16Libcall Call,
Entry.isZExt = !isSigned;
Args.push_back(Entry);
}

SDValue Callee = DAG.getExternalSymbol(getPIC16LibcallName(Call), EVT::i16);

const Type *RetTy = RetVT.getTypeForEVT();
Expand Down Expand Up @@ -1086,6 +1087,7 @@ SDValue PIC16TargetLowering::
LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
SDValue DataAddr_Lo, SDValue DataAddr_Hi,
const SmallVectorImpl<ISD::OutputArg> &Outs,
const SmallVectorImpl<ISD::InputArg> &Ins,
DebugLoc dl, SelectionDAG &DAG) {
unsigned NumOps = Outs.size();

Expand All @@ -1098,7 +1100,7 @@ LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
SDValue Arg, StoreRet;

// For PIC16 ABI the arguments come after the return value.
unsigned RetVals = Outs.size();
unsigned RetVals = Ins.size();
for (unsigned i = 0, ArgOffset = RetVals; i < NumOps; i++) {
// Get the arguments
Arg = Outs[i].Val;
Expand Down Expand Up @@ -1430,7 +1432,7 @@ PIC16TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
OperFlag = getOutFlag(CallArgs);
} else {
CallArgs = LowerIndirectCallArguments(Chain, OperFlag, DataAddr_Lo,
DataAddr_Hi, Outs, dl, DAG);
DataAddr_Hi, Outs, Ins, dl, DAG);
Chain = getChain(CallArgs);
OperFlag = getOutFlag(CallArgs);
}
Expand Down
1 change: 1 addition & 0 deletions lib/Target/PIC16/PIC16ISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ namespace llvm {
LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
SDValue DataAddr_Lo, SDValue DataAddr_Hi,
const SmallVectorImpl<ISD::OutputArg> &Outs,
const SmallVectorImpl<ISD::InputArg> &Ins,
DebugLoc dl, SelectionDAG &DAG);

SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG);
Expand Down

0 comments on commit a418628

Please sign in to comment.