mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
implement vaarg. Varargs now should work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24986 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c4769bb529
commit
74fa64b072
@ -578,8 +578,19 @@ LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV,
|
||||
std::pair<SDOperand,SDOperand> SparcV8TargetLowering::
|
||||
LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
|
||||
const Type *ArgTy, SelectionDAG &DAG) {
|
||||
assert(0 && "Unimp");
|
||||
abort();
|
||||
// Load the pointer out of the valist.
|
||||
SDOperand Ptr = DAG.getLoad(MVT::i32, Chain,
|
||||
VAListP, DAG.getSrcValue(VAListV));
|
||||
MVT::ValueType ArgVT = getValueType(ArgTy);
|
||||
SDOperand Val = DAG.getLoad(ArgVT, Ptr.getValue(1),
|
||||
Ptr, DAG.getSrcValue(NULL));
|
||||
// Increment the pointer.
|
||||
Ptr = DAG.getNode(ISD::ADD, MVT::i32, Ptr,
|
||||
DAG.getConstant(MVT::getSizeInBits(ArgVT)/8, MVT::i32));
|
||||
// Store it back to the valist.
|
||||
Chain = DAG.getNode(ISD::STORE, MVT::Other, Chain, Ptr,
|
||||
VAListP, DAG.getSrcValue(VAListV));
|
||||
return std::make_pair(Val, Chain);
|
||||
}
|
||||
|
||||
std::pair<SDOperand, SDOperand> SparcV8TargetLowering::
|
||||
|
@ -578,8 +578,19 @@ LowerVAStart(SDOperand Chain, SDOperand VAListP, Value *VAListV,
|
||||
std::pair<SDOperand,SDOperand> SparcV8TargetLowering::
|
||||
LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
|
||||
const Type *ArgTy, SelectionDAG &DAG) {
|
||||
assert(0 && "Unimp");
|
||||
abort();
|
||||
// Load the pointer out of the valist.
|
||||
SDOperand Ptr = DAG.getLoad(MVT::i32, Chain,
|
||||
VAListP, DAG.getSrcValue(VAListV));
|
||||
MVT::ValueType ArgVT = getValueType(ArgTy);
|
||||
SDOperand Val = DAG.getLoad(ArgVT, Ptr.getValue(1),
|
||||
Ptr, DAG.getSrcValue(NULL));
|
||||
// Increment the pointer.
|
||||
Ptr = DAG.getNode(ISD::ADD, MVT::i32, Ptr,
|
||||
DAG.getConstant(MVT::getSizeInBits(ArgVT)/8, MVT::i32));
|
||||
// Store it back to the valist.
|
||||
Chain = DAG.getNode(ISD::STORE, MVT::Other, Chain, Ptr,
|
||||
VAListP, DAG.getSrcValue(VAListV));
|
||||
return std::make_pair(Val, Chain);
|
||||
}
|
||||
|
||||
std::pair<SDOperand, SDOperand> SparcV8TargetLowering::
|
||||
|
Loading…
Reference in New Issue
Block a user