mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
Pass calling convention to use into lower call to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c57f682113
commit
9092fa310c
@ -928,7 +928,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::pair<SDOperand,SDOperand> CallResult =
|
std::pair<SDOperand,SDOperand> CallResult =
|
||||||
TLI.LowerCallTo(Tmp1, Type::VoidTy, false,
|
TLI.LowerCallTo(Tmp1, Type::VoidTy, false, 0,
|
||||||
DAG.getExternalSymbol(FnName, IntPtr), Args, DAG);
|
DAG.getExternalSymbol(FnName, IntPtr), Args, DAG);
|
||||||
Result = LegalizeOp(CallResult.second);
|
Result = LegalizeOp(CallResult.second);
|
||||||
break;
|
break;
|
||||||
@ -1253,7 +1253,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
Args.push_back(std::make_pair(Tmp1, T));
|
Args.push_back(std::make_pair(Tmp1, T));
|
||||||
// FIXME: should use ExpandLibCall!
|
// FIXME: should use ExpandLibCall!
|
||||||
std::pair<SDOperand,SDOperand> CallResult =
|
std::pair<SDOperand,SDOperand> CallResult =
|
||||||
TLI.LowerCallTo(DAG.getEntryNode(), T, false,
|
TLI.LowerCallTo(DAG.getEntryNode(), T, false, 0,
|
||||||
DAG.getExternalSymbol(FnName, VT), Args, DAG);
|
DAG.getExternalSymbol(FnName, VT), Args, DAG);
|
||||||
Result = LegalizeOp(CallResult.first);
|
Result = LegalizeOp(CallResult.first);
|
||||||
break;
|
break;
|
||||||
@ -2102,7 +2102,7 @@ SDOperand SelectionDAGLegalize::ExpandLibCall(const char *Name, SDNode *Node,
|
|||||||
// Splice the libcall in wherever FindInputOutputChains tells us to.
|
// Splice the libcall in wherever FindInputOutputChains tells us to.
|
||||||
const Type *RetTy = MVT::getTypeForValueType(Node->getValueType(0));
|
const Type *RetTy = MVT::getTypeForValueType(Node->getValueType(0));
|
||||||
std::pair<SDOperand,SDOperand> CallInfo =
|
std::pair<SDOperand,SDOperand> CallInfo =
|
||||||
TLI.LowerCallTo(InChain, RetTy, false, Callee, Args, DAG);
|
TLI.LowerCallTo(InChain, RetTy, false, 0, Callee, Args, DAG);
|
||||||
SpliceCallInto(CallInfo.second, OutChain);
|
SpliceCallInto(CallInfo.second, OutChain);
|
||||||
|
|
||||||
NeedsAnotherIteration = true;
|
NeedsAnotherIteration = true;
|
||||||
@ -2198,7 +2198,7 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
|
|||||||
const Type *RetTy = MVT::getTypeForValueType(DestTy);
|
const Type *RetTy = MVT::getTypeForValueType(DestTy);
|
||||||
|
|
||||||
std::pair<SDOperand,SDOperand> CallResult =
|
std::pair<SDOperand,SDOperand> CallResult =
|
||||||
TLI.LowerCallTo(InChain, RetTy, false, Callee, Args, DAG);
|
TLI.LowerCallTo(InChain, RetTy, false, 0, Callee, Args, DAG);
|
||||||
|
|
||||||
SpliceCallInto(CallResult.second, OutChain);
|
SpliceCallInto(CallResult.second, OutChain);
|
||||||
return CallResult.first;
|
return CallResult.first;
|
||||||
|
@ -773,7 +773,8 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
|
|||||||
const FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
const FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
||||||
|
|
||||||
std::pair<SDOperand,SDOperand> Result =
|
std::pair<SDOperand,SDOperand> Result =
|
||||||
TLI.LowerCallTo(getRoot(), I.getType(), FTy->isVarArg(), Callee, Args, DAG);
|
TLI.LowerCallTo(getRoot(), I.getType(), FTy->isVarArg(), I.getCallingConv(),
|
||||||
|
Callee, Args, DAG);
|
||||||
if (I.getType() != Type::VoidTy)
|
if (I.getType() != Type::VoidTy)
|
||||||
setValue(&I, Result.first);
|
setValue(&I, Result.first);
|
||||||
DAG.setRoot(Result.second);
|
DAG.setRoot(Result.second);
|
||||||
@ -798,7 +799,7 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) {
|
|||||||
Args.push_back(std::make_pair(Src, TLI.getTargetData().getIntPtrType()));
|
Args.push_back(std::make_pair(Src, TLI.getTargetData().getIntPtrType()));
|
||||||
|
|
||||||
std::pair<SDOperand,SDOperand> Result =
|
std::pair<SDOperand,SDOperand> Result =
|
||||||
TLI.LowerCallTo(getRoot(), I.getType(), false,
|
TLI.LowerCallTo(getRoot(), I.getType(), false, 0,
|
||||||
DAG.getExternalSymbol("malloc", IntPtr),
|
DAG.getExternalSymbol("malloc", IntPtr),
|
||||||
Args, DAG);
|
Args, DAG);
|
||||||
setValue(&I, Result.first); // Pointers always fit in registers
|
setValue(&I, Result.first); // Pointers always fit in registers
|
||||||
@ -811,7 +812,7 @@ void SelectionDAGLowering::visitFree(FreeInst &I) {
|
|||||||
TLI.getTargetData().getIntPtrType()));
|
TLI.getTargetData().getIntPtrType()));
|
||||||
MVT::ValueType IntPtr = TLI.getPointerTy();
|
MVT::ValueType IntPtr = TLI.getPointerTy();
|
||||||
std::pair<SDOperand,SDOperand> Result =
|
std::pair<SDOperand,SDOperand> Result =
|
||||||
TLI.LowerCallTo(getRoot(), Type::VoidTy, false,
|
TLI.LowerCallTo(getRoot(), Type::VoidTy, false, 0,
|
||||||
DAG.getExternalSymbol("free", IntPtr), Args, DAG);
|
DAG.getExternalSymbol("free", IntPtr), Args, DAG);
|
||||||
DAG.setRoot(Result.second);
|
DAG.setRoot(Result.second);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user