diff options
author | Tilmann Scheller <tilmann.scheller@googlemail.com> | 2009-07-03 06:44:53 +0000 |
---|---|---|
committer | Tilmann Scheller <tilmann.scheller@googlemail.com> | 2009-07-03 06:44:53 +0000 |
commit | 71c697382e6165ab1b601866a52c8f6628517e42 (patch) | |
tree | 3a820b1c222ffd076cda7f78b4c8595e7a32f7bc /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | ff2c8fd8eac31ca12953bce58851fd2ed4aac204 (diff) | |
download | external_llvm-71c697382e6165ab1b601866a52c8f6628517e42.zip external_llvm-71c697382e6165ab1b601866a52c8f6628517e42.tar.gz external_llvm-71c697382e6165ab1b601866a52c8f6628517e42.tar.bz2 |
Add NumFixedArgs attribute to CallSDNode which indicates the number of fixed arguments in a vararg call.
With the SVR4 ABI on PowerPC, vector arguments for vararg calls are passed differently depending on whether they are a fixed or a variable argument. Variable vector arguments always go into memory, fixed vector arguments are put
into vector registers. If there are no free vector registers available, fixed vector arguments are put on the stack.
The NumFixedArgs attribute allows to decide for an argument in a vararg call whether it belongs to the fixed or variable portion of the parameter list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index adf0478..9752537 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -2257,6 +2257,7 @@ class CallSDNode : public SDNode { unsigned CallingConv; bool IsVarArg; bool IsTailCall; + unsigned NumFixedArgs; // We might eventually want a full-blown Attributes for the result; that // will expand the size of the representation. At the moment we only // need Inreg. @@ -2264,10 +2265,10 @@ class CallSDNode : public SDNode { friend class SelectionDAG; CallSDNode(unsigned cc, DebugLoc dl, bool isvararg, bool istailcall, bool isinreg, SDVTList VTs, const SDValue *Operands, - unsigned numOperands) + unsigned numOperands, unsigned numFixedArgs) : SDNode(ISD::CALL, dl, VTs, Operands, numOperands), CallingConv(cc), IsVarArg(isvararg), IsTailCall(istailcall), - Inreg(isinreg) {} + NumFixedArgs(numFixedArgs), Inreg(isinreg) {} public: unsigned getCallingConv() const { return CallingConv; } unsigned isVarArg() const { return IsVarArg; } @@ -2284,6 +2285,12 @@ public: SDValue getCallee() const { return getOperand(1); } unsigned getNumArgs() const { return (getNumOperands() - 2) / 2; } + unsigned getNumFixedArgs() const { + if (isVarArg()) + return NumFixedArgs; + else + return getNumArgs(); + } SDValue getArg(unsigned i) const { return getOperand(2+2*i); } SDValue getArgFlagsVal(unsigned i) const { return getOperand(3+2*i); |