mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Change interface to LowerCallTo to take a boolean isVarArg argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20842 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
307e7443b8
commit
8e21e71b24
@ -786,7 +786,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
assert(0 && "Unknown op!");
|
||||
}
|
||||
std::pair<SDOperand,SDOperand> CallResult =
|
||||
TLI.LowerCallTo(Tmp1, Type::VoidTy,
|
||||
TLI.LowerCallTo(Tmp1, Type::VoidTy, false,
|
||||
DAG.getExternalSymbol(FnName, IntPtr), Args, DAG);
|
||||
Result = LegalizeOp(CallResult.second);
|
||||
break;
|
||||
@ -1473,7 +1473,7 @@ SDOperand SelectionDAGLegalize::ExpandLibCall(const char *Name, SDNode *Node,
|
||||
// node as our input and ignore the output chain. This allows us to place
|
||||
// calls wherever we need them to satisfy data dependences.
|
||||
const Type *RetTy = MVT::getTypeForValueType(Node->getValueType(0));
|
||||
SDOperand Result = TLI.LowerCallTo(InChain, RetTy, Callee,
|
||||
SDOperand Result = TLI.LowerCallTo(InChain, RetTy, false, Callee,
|
||||
Args, DAG).first;
|
||||
switch (getTypeAction(Result.getValueType())) {
|
||||
default: assert(0 && "Unknown thing");
|
||||
@ -1527,7 +1527,7 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
|
||||
// node as our input and ignore the output chain. This allows us to place
|
||||
// calls wherever we need them to satisfy data dependences.
|
||||
const Type *RetTy = MVT::getTypeForValueType(DestTy);
|
||||
return TLI.LowerCallTo(InChain, RetTy, Callee, Args, DAG).first;
|
||||
return TLI.LowerCallTo(InChain, RetTy, false, Callee, Args, DAG).first;
|
||||
|
||||
}
|
||||
|
||||
|
@ -670,8 +670,11 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
|
||||
Args.push_back(std::make_pair(ArgNode, Arg->getType()));
|
||||
}
|
||||
|
||||
const PointerType *PT = cast<PointerType>(I.getCalledValue()->getType());
|
||||
const FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
||||
|
||||
std::pair<SDOperand,SDOperand> Result =
|
||||
TLI.LowerCallTo(getRoot(), I.getType(), Callee, Args, DAG);
|
||||
TLI.LowerCallTo(getRoot(), I.getType(), FTy->isVarArg(), Callee, Args, DAG);
|
||||
if (I.getType() != Type::VoidTy)
|
||||
setValue(&I, Result.first);
|
||||
DAG.setRoot(Result.second);
|
||||
@ -696,7 +699,7 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) {
|
||||
Args.push_back(std::make_pair(Src, TLI.getTargetData().getIntPtrType()));
|
||||
|
||||
std::pair<SDOperand,SDOperand> Result =
|
||||
TLI.LowerCallTo(getRoot(), I.getType(),
|
||||
TLI.LowerCallTo(getRoot(), I.getType(), false,
|
||||
DAG.getExternalSymbol("malloc", IntPtr),
|
||||
Args, DAG);
|
||||
setValue(&I, Result.first); // Pointers always fit in registers
|
||||
@ -709,7 +712,7 @@ void SelectionDAGLowering::visitFree(FreeInst &I) {
|
||||
TLI.getTargetData().getIntPtrType()));
|
||||
MVT::ValueType IntPtr = TLI.getPointerTy();
|
||||
std::pair<SDOperand,SDOperand> Result =
|
||||
TLI.LowerCallTo(getRoot(), Type::VoidTy,
|
||||
TLI.LowerCallTo(getRoot(), Type::VoidTy, false,
|
||||
DAG.getExternalSymbol("free", IntPtr), Args, DAG);
|
||||
DAG.setRoot(Result.second);
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ namespace {
|
||||
/// LowerCallTo - This hook lowers an abstract call to a function into an
|
||||
/// actual call.
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG);
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
|
||||
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerVAStart(SDOperand Chain, SelectionDAG &DAG);
|
||||
@ -210,8 +210,8 @@ AlphaTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG)
|
||||
|
||||
std::pair<SDOperand, SDOperand>
|
||||
AlphaTargetLowering::LowerCallTo(SDOperand Chain,
|
||||
const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG) {
|
||||
const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) {
|
||||
int NumBytes = 0;
|
||||
if (Args.size() > 6)
|
||||
NumBytes = (Args.size() - 6) * 8;
|
||||
|
@ -97,8 +97,8 @@ namespace {
|
||||
/// LowerCallTo - This hook lowers an abstract call to a function into an
|
||||
/// actual call.
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG);
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
|
||||
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerVAStart(SDOperand Chain, SelectionDAG &DAG);
|
||||
@ -248,8 +248,8 @@ IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
|
||||
|
||||
std::pair<SDOperand, SDOperand>
|
||||
IA64TargetLowering::LowerCallTo(SDOperand Chain,
|
||||
const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG) {
|
||||
const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) {
|
||||
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
|
||||
|
@ -84,8 +84,8 @@ namespace {
|
||||
/// LowerCallTo - This hook lowers an abstract call to a function into an
|
||||
/// actual call.
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG);
|
||||
LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG);
|
||||
|
||||
virtual std::pair<SDOperand, SDOperand>
|
||||
LowerVAStart(SDOperand Chain, SelectionDAG &DAG);
|
||||
@ -163,8 +163,8 @@ X86TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
|
||||
|
||||
std::pair<SDOperand, SDOperand>
|
||||
X86TargetLowering::LowerCallTo(SDOperand Chain,
|
||||
const Type *RetTy, SDOperand Callee,
|
||||
ArgListTy &Args, SelectionDAG &DAG) {
|
||||
const Type *RetTy, bool isVarArg,
|
||||
SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) {
|
||||
// Count how many bytes are to be pushed on the stack.
|
||||
unsigned NumBytes = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user