From 4ba3fd45bb134e4a5119f297537adce4e7ef4a39 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 9 Jan 2012 19:08:06 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147786 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 962339ab77..72b40d3d59 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -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(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. -- 2.50.1