diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-13 01:54:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-13 01:54:27 +0000 |
commit | 095cc29f321382e1f7d295e262a28197f92c5491 (patch) | |
tree | be6c4833a95fbd06a8315df342c5ee55aef50473 /include/llvm/Target | |
parent | e7de7e3574245fe4cdee3ea895c3aeabca04db63 (diff) | |
download | llvm-095cc29f321382e1f7d295e262a28197f92c5491.tar.gz llvm-095cc29f321382e1f7d295e262a28197f92c5491.tar.bz2 llvm-095cc29f321382e1f7d295e262a28197f92c5491.tar.xz |
Define CallSDNode, an SDNode subclass for use with ISD::CALL.
Currently it just holds the calling convention and flags
for isVarArgs and isTailCall.
And it has several utility methods, which eliminate magic
5+2*i and similar index computations in several places.
CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle
nodes that are not CSE'd gracefully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 85279bb581..af5641674c 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -1075,7 +1075,7 @@ public: /// IsEligibleForTailCallOptimization - Check whether the call is eligible for /// tail call optimization. Targets which want to do tail call optimization /// should override this function. - virtual bool IsEligibleForTailCallOptimization(SDValue Call, + virtual bool IsEligibleForTailCallOptimization(CallSDNode *Call, SDValue Ret, SelectionDAG &DAG) const { return false; @@ -1085,15 +1085,15 @@ public: /// preceeds the RET node and whether the return uses the result of the node /// or is a void return. This function can be used by the target to determine /// eligiblity of tail call optimization. - static bool CheckTailCallReturnConstraints(SDValue Call, SDValue Ret) { + static bool CheckTailCallReturnConstraints(CallSDNode *TheCall, SDValue Ret) { unsigned NumOps = Ret.getNumOperands(); if ((NumOps == 1 && - (Ret.getOperand(0) == SDValue(Call.getNode(),1) || - Ret.getOperand(0) == SDValue(Call.getNode(),0))) || + (Ret.getOperand(0) == SDValue(TheCall,1) || + Ret.getOperand(0) == SDValue(TheCall,0))) || (NumOps > 1 && - Ret.getOperand(0) == SDValue(Call.getNode(), - Call.getNode()->getNumValues()-1) && - Ret.getOperand(1) == SDValue(Call.getNode(),0))) + Ret.getOperand(0) == SDValue(TheCall, + TheCall->getNumValues()-1) && + Ret.getOperand(1) == SDValue(TheCall,0))) return true; return false; } |