]> granicus.if.org Git - clang/commitdiff
Move the piece of code up that skips the padding argument. Without this change,
authorAkira Hatanaka <ahatanaka@mips.com>
Mon, 9 Jan 2012 19:08:06 +0000 (19:08 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Mon, 9 Jan 2012 19:08:06 +0000 (19:08 +0000)
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

index 962339ab77a8dde18b92cb45399b73d23f19285b..72b40d3d595c3f59ae3244708f82790fdb83ae8c 100644 (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.