diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-13 18:50:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-13 18:50:42 +0000 |
commit | 2e77db6af66b2657b32642df1f635837467a9f62 (patch) | |
tree | 7dfe24c91ff6e73e821e4fcae51ff06d22833045 /llvm/lib/CodeGen | |
parent | d0feb644432512e9af5edab6791c1da46f6668f7 (diff) | |
download | bcm5719-llvm-2e77db6af66b2657b32642df1f635837467a9f62.tar.gz bcm5719-llvm-2e77db6af66b2657b32642df1f635837467a9f62.zip |
Add an isTailCall flag to LowerCallTo
llvm-svn: 21958
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 14b4c5a4b23..91badeb2bdf 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -18,6 +18,7 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/CallingConv.h" #include "llvm/Constants.h" #include <iostream> using namespace llvm; @@ -930,7 +931,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { } std::pair<SDOperand,SDOperand> CallResult = - TLI.LowerCallTo(Tmp1, Type::VoidTy, false, 0, + TLI.LowerCallTo(Tmp1, Type::VoidTy, false, CallingConv::C, false, DAG.getExternalSymbol(FnName, IntPtr), Args, DAG); Result = LegalizeOp(CallResult.second); break; @@ -1255,7 +1256,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Args.push_back(std::make_pair(Tmp1, T)); // FIXME: should use ExpandLibCall! std::pair<SDOperand,SDOperand> CallResult = - TLI.LowerCallTo(DAG.getEntryNode(), T, false, 0, + TLI.LowerCallTo(DAG.getEntryNode(), T, false, CallingConv::C, true, DAG.getExternalSymbol(FnName, VT), Args, DAG); Result = LegalizeOp(CallResult.first); break; @@ -2107,7 +2108,8 @@ SDOperand SelectionDAGLegalize::ExpandLibCall(const char *Name, SDNode *Node, // Splice the libcall in wherever FindInputOutputChains tells us to. const Type *RetTy = MVT::getTypeForValueType(Node->getValueType(0)); std::pair<SDOperand,SDOperand> CallInfo = - TLI.LowerCallTo(InChain, RetTy, false, 0, Callee, Args, DAG); + TLI.LowerCallTo(InChain, RetTy, false, CallingConv::C, false, + Callee, Args, DAG); SpliceCallInto(CallInfo.second, OutChain); NeedsAnotherIteration = true; @@ -2204,7 +2206,8 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) { const Type *RetTy = MVT::getTypeForValueType(DestTy); std::pair<SDOperand,SDOperand> CallResult = - TLI.LowerCallTo(InChain, RetTy, false, 0, Callee, Args, DAG); + TLI.LowerCallTo(InChain, RetTy, false, CallingConv::C, true, + Callee, Args, DAG); SpliceCallInto(CallResult.second, OutChain); return CallResult.first; diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 70ba42e03a2..e088845daa8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -13,6 +13,7 @@ #define DEBUG_TYPE "isel" #include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" @@ -774,7 +775,7 @@ void SelectionDAGLowering::visitCall(CallInst &I) { std::pair<SDOperand,SDOperand> Result = TLI.LowerCallTo(getRoot(), I.getType(), FTy->isVarArg(), I.getCallingConv(), - Callee, Args, DAG); + I.isTailCall(), Callee, Args, DAG); if (I.getType() != Type::VoidTy) setValue(&I, Result.first); DAG.setRoot(Result.second); @@ -799,7 +800,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(), false, 0, + TLI.LowerCallTo(getRoot(), I.getType(), false, CallingConv::C, true, DAG.getExternalSymbol("malloc", IntPtr), Args, DAG); setValue(&I, Result.first); // Pointers always fit in registers @@ -812,7 +813,7 @@ void SelectionDAGLowering::visitFree(FreeInst &I) { TLI.getTargetData().getIntPtrType())); MVT::ValueType IntPtr = TLI.getPointerTy(); std::pair<SDOperand,SDOperand> Result = - TLI.LowerCallTo(getRoot(), Type::VoidTy, false, 0, + TLI.LowerCallTo(getRoot(), Type::VoidTy, false, CallingConv::C, true, DAG.getExternalSymbol("free", IntPtr), Args, DAG); DAG.setRoot(Result.second); } |