diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-06 15:39:54 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-06 15:39:54 +0000 |
commit | 4e49b59dadd12b66a74350abedba235da260182a (patch) | |
tree | 68ceee2937e4ba31c30a31ad93705bcd060dc928 /llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp | |
parent | 39fdf81b43020803c429b903bf3e8cc100a2bd1e (diff) | |
download | bcm5719-llvm-4e49b59dadd12b66a74350abedba235da260182a.tar.gz bcm5719-llvm-4e49b59dadd12b66a74350abedba235da260182a.zip |
Add versions of OutputArgReg, AnalyzeReturn, and AnalyzeCallOperands
which do not depend on SelectionDAG.
llvm-svn: 107666
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp b/llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp index 4e6c1fcc960..ba097e089aa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp @@ -111,6 +111,22 @@ void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs, } } +void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArgReg> &Outs, + CCAssignFn Fn) { + // Determine which register each value should be copied into. + for (unsigned i = 0, e = Outs.size(); i != e; ++i) { + EVT VT = Outs[i].VT; + ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; + if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { +#ifndef NDEBUG + dbgs() << "Return operand #" << i << " has unhandled type " + << VT.getEVTString(); +#endif + llvm_unreachable(0); + } + } +} + /// AnalyzeCallOperands - Analyze the outgoing arguments to a call, /// incorporating info about the passed values into this state. @@ -130,6 +146,25 @@ void CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs, } } +/// AnalyzeCallOperands - Analyze the outgoing arguments to a call, +/// incorporating info about the passed values into this state. +void +CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArgReg> &Outs, + CCAssignFn Fn) { + unsigned NumOps = Outs.size(); + for (unsigned i = 0; i != NumOps; ++i) { + EVT ArgVT = Outs[i].VT; + ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; + if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { +#ifndef NDEBUG + dbgs() << "Call operand #" << i << " has unhandled type " + << ArgVT.getEVTString(); +#endif + llvm_unreachable(0); + } + } +} + /// AnalyzeCallOperands - Same as above except it takes vectors of types /// and argument flags. void CCState::AnalyzeCallOperands(SmallVectorImpl<EVT> &ArgVTs, |