if (FI.getReturnInfo().isIndirect())
--freeIntRegs;
- bool isVariadic = FI.isVariadic();
- unsigned numRequiredArgs = 0;
- if (isVariadic)
- numRequiredArgs = FI.getRequiredArgs().getNumRequiredArgs();
-
+ unsigned NumRequiredArgs = FI.getNumRequiredArgs();
// AMD64-ABI 3.2.3p3: Once arguments are classified, the registers
// get assigned (in left-to-right order) for passing as follows...
+ unsigned ArgNo = 0;
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
- it != ie; ++it) {
- bool isNamedArg = true;
- if (isVariadic)
- isNamedArg = (it - FI.arg_begin()) <
- static_cast<signed>(numRequiredArgs);
+ it != ie; ++it, ++ArgNo) {
+ bool IsNamedArg = ArgNo < NumRequiredArgs;
unsigned neededInt, neededSSE;
it->info = classifyArgumentType(it->type, freeIntRegs, neededInt,
- neededSSE, isNamedArg);
+ neededSSE, IsNamedArg);
// AMD64-ABI 3.2.3p3: If there are no registers available for any
// eightbyte of an argument, the whole argument is passed on the
// Find the number of named arguments. Variadic arguments get special
// treatment with the Darwin ABI.
- unsigned NumRequiredArgs = (FI.isVariadic() ?
- FI.getRequiredArgs().getNumRequiredArgs() :
- FI.arg_size());
+ unsigned NumRequiredArgs = FI.getNumRequiredArgs();
if (!getCXXABI().classifyReturnType(FI))
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
+ unsigned ArgNo = 0;
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
- it != ie; ++it) {
+ it != ie; ++it, ++ArgNo) {
unsigned PreAllocation = AllocatedVFP, PreGPR = AllocatedGPR;
bool IsHA = false, IsSmallAggr = false;
const unsigned NumVFPs = 8;
const unsigned NumGPRs = 8;
- bool IsNamedArg = ((it - FI.arg_begin()) <
- static_cast<signed>(NumRequiredArgs));
+ bool IsNamedArg = ArgNo < NumRequiredArgs;
it->info = classifyArgumentType(it->type, AllocatedVFP, IsHA,
AllocatedGPR, IsSmallAggr, IsNamedArg);