Move the piece of code up that skips the padding argument. Without this change,

padding insertion will not work if the coerced type is not a structure.

llvm-svn: 147786
This commit is contained in:
Akira Hatanaka
2012-01-09 19:08:06 +00:00
parent 4dc3eff5ae
commit 18334dd9e9

View File

@@ -988,6 +988,10 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
case ABIArgInfo::Extend:
case ABIArgInfo::Direct: {
// Skip the dummy padding argument.
if (ArgI.getPaddingType())
++AI;
// If we have the trivial case, handle it with no muss and fuss.
if (!isa<llvm::StructType>(ArgI.getCoerceToType()) &&
ArgI.getCoerceToType() == ConvertType(Ty) &&
@@ -1030,10 +1034,6 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
llvm::PointerType::getUnqual(ArgI.getCoerceToType()));
}
// Skip the dummy padding argument.
if (ArgI.getPaddingType())
++AI;
// If the coerce-to type is a first class aggregate, we flatten it and
// pass the elements. Either way is semantically identical, but fast-isel
// and the optimizer generally likes scalar values better than FCAs.