aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-13 18:40:17 +0000
committerChris Lattner <sabre@nondot.org>2005-05-13 18:40:17 +0000
commit4c1eae9fb329e0e371d453957c56426294de24e9 (patch)
treec4f160e7d417e0f737ea143e4ae1cf20ecdd55cc /include/llvm/CodeGen
parent069b96380f7b3ea30f790d5e206cc5036992b7f9 (diff)
downloadexternal_llvm-4c1eae9fb329e0e371d453957c56426294de24e9.zip
external_llvm-4c1eae9fb329e0e371d453957c56426294de24e9.tar.gz
external_llvm-4c1eae9fb329e0e371d453957c56426294de24e9.tar.bz2
add TAILCALL node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h8
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index c7fa36c..26e11b6 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -129,8 +129,8 @@ public:
/// getCall - Note that this destroys the vector of RetVals passed in.
///
SDNode *getCall(std::vector<MVT::ValueType> &RetVals, SDOperand Chain,
- SDOperand Callee) {
- SDNode *NN = new SDNode(ISD::CALL, Chain, Callee);
+ SDOperand Callee, bool isTailCall = false) {
+ SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, Chain, Callee);
NN->setValueTypes(RetVals);
AllNodes.push_back(NN);
return NN;
@@ -140,10 +140,10 @@ public:
/// where arguments are passed in physical registers. This destroys the
/// RetVals and ArgsInRegs vectors.
SDNode *getCall(std::vector<MVT::ValueType> &RetVals, SDOperand Chain,
- SDOperand Callee, std::vector<SDOperand> &ArgsInRegs) {
+ SDOperand Callee, std::vector<SDOperand> &ArgsInRegs, bool isTailCall = false) {
ArgsInRegs.insert(ArgsInRegs.begin(), Callee);
ArgsInRegs.insert(ArgsInRegs.begin(), Chain);
- SDNode *NN = new SDNode(ISD::CALL, ArgsInRegs);
+ SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, ArgsInRegs);
NN->setValueTypes(RetVals);
AllNodes.push_back(NN);
return NN;
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index b3ac7db..06a7b20 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -234,8 +234,10 @@ namespace ISD {
// CALL - Call to a function pointer. The first operand is the chain, the
// second is the destination function pointer (a GlobalAddress for a direct
// call). Arguments have already been lowered to explicit DAGs according to
- // the calling convention in effect here.
+ // the calling convention in effect here. TAILCALL is the same as CALL, but
+ // the callee is known not to access the stack of the caller.
CALL,
+ TAILCALL,
// MEMSET/MEMCPY/MEMMOVE - The first operand is the chain, and the rest
// correspond to the operands of the LLVM intrinsic functions. The only