diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 37b6ab5e51..215cf78c5b 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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; } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 48574da388..c4df0cdc27 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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); } |