@@ -89,7 +89,7 @@ CCState::AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
8989 for (unsigned i = 0 ; i != NumArgs; ++i) {
9090 MVT ArgVT = Ins[i].VT ;
9191 ISD::ArgFlagsTy ArgFlags = Ins[i].Flags ;
92- if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this ))
92+ if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, Ins[i]. OrigTy , *this ))
9393 report_fatal_error (" unable to allocate function argument #" + Twine (i));
9494 }
9595}
@@ -102,7 +102,7 @@ bool CCState::CheckReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
102102 for (unsigned i = 0 , e = Outs.size (); i != e; ++i) {
103103 MVT VT = Outs[i].VT ;
104104 ISD::ArgFlagsTy ArgFlags = Outs[i].Flags ;
105- if (Fn (i, VT, VT, CCValAssign::Full, ArgFlags, *this ))
105+ if (Fn (i, VT, VT, CCValAssign::Full, ArgFlags, Outs[i]. OrigTy , *this ))
106106 return false ;
107107 }
108108 return true ;
@@ -116,7 +116,7 @@ void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
116116 for (unsigned i = 0 , e = Outs.size (); i != e; ++i) {
117117 MVT VT = Outs[i].VT ;
118118 ISD::ArgFlagsTy ArgFlags = Outs[i].Flags ;
119- if (Fn (i, VT, VT, CCValAssign::Full, ArgFlags, *this ))
119+ if (Fn (i, VT, VT, CCValAssign::Full, ArgFlags, Outs[i]. OrigTy , *this ))
120120 report_fatal_error (" unable to allocate function return #" + Twine (i));
121121 }
122122}
@@ -129,7 +129,8 @@ void CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
129129 for (unsigned i = 0 ; i != NumOps; ++i) {
130130 MVT ArgVT = Outs[i].VT ;
131131 ISD::ArgFlagsTy ArgFlags = Outs[i].Flags ;
132- if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this )) {
132+ if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, Outs[i].OrigTy ,
133+ *this )) {
133134#ifndef NDEBUG
134135 dbgs () << " Call operand #" << i << " has unhandled type "
135136 << ArgVT << ' \n ' ;
@@ -142,12 +143,13 @@ void CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
142143// / Same as above except it takes vectors of types and argument flags.
143144void CCState::AnalyzeCallOperands (SmallVectorImpl<MVT> &ArgVTs,
144145 SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
146+ SmallVectorImpl<Type *> &OrigTys,
145147 CCAssignFn Fn) {
146148 unsigned NumOps = ArgVTs.size ();
147149 for (unsigned i = 0 ; i != NumOps; ++i) {
148150 MVT ArgVT = ArgVTs[i];
149151 ISD::ArgFlagsTy ArgFlags = Flags[i];
150- if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this )) {
152+ if (Fn (i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, OrigTys[i], *this )) {
151153#ifndef NDEBUG
152154 dbgs () << " Call operand #" << i << " has unhandled type "
153155 << ArgVT << ' \n ' ;
@@ -164,7 +166,7 @@ void CCState::AnalyzeCallResult(const SmallVectorImpl<ISD::InputArg> &Ins,
164166 for (unsigned i = 0 , e = Ins.size (); i != e; ++i) {
165167 MVT VT = Ins[i].VT ;
166168 ISD::ArgFlagsTy Flags = Ins[i].Flags ;
167- if (Fn (i, VT, VT, CCValAssign::Full, Flags, *this )) {
169+ if (Fn (i, VT, VT, CCValAssign::Full, Flags, Ins[i]. OrigTy , *this )) {
168170#ifndef NDEBUG
169171 dbgs () << " Call result #" << i << " has unhandled type "
170172 << VT << ' \n ' ;
@@ -175,8 +177,8 @@ void CCState::AnalyzeCallResult(const SmallVectorImpl<ISD::InputArg> &Ins,
175177}
176178
177179// / Same as above except it's specialized for calls that produce a single value.
178- void CCState::AnalyzeCallResult (MVT VT, CCAssignFn Fn) {
179- if (Fn (0 , VT, VT, CCValAssign::Full, ISD::ArgFlagsTy (), *this )) {
180+ void CCState::AnalyzeCallResult (MVT VT, Type *OrigTy, CCAssignFn Fn) {
181+ if (Fn (0 , VT, VT, CCValAssign::Full, ISD::ArgFlagsTy (), OrigTy, *this )) {
180182#ifndef NDEBUG
181183 dbgs () << " Call result has unhandled type "
182184 << VT << ' \n ' ;
@@ -213,7 +215,8 @@ void CCState::getRemainingRegParmsForType(SmallVectorImpl<MCRegister> &Regs,
213215 // location in memory.
214216 bool HaveRegParm;
215217 do {
216- if (Fn (0 , VT, VT, CCValAssign::Full, Flags, *this )) {
218+ Type *OrigTy = EVT (VT).getTypeForEVT (Context);
219+ if (Fn (0 , VT, VT, CCValAssign::Full, Flags, OrigTy, *this )) {
217220#ifndef NDEBUG
218221 dbgs () << " Call has unhandled type " << VT
219222 << " while computing remaining regparms\n " ;
0 commit comments