[cfe-commits] r147786 - /cfe/trunk/lib/CodeGen/CGCall.cpp

Akira Hatanaka ahatanaka at mips.com
Mon Jan 9 11:08:06 PST 2012


Author: ahatanak
Date: Mon Jan  9 13:08:06 2012
New Revision: 147786

URL: http://llvm.org/viewvc/llvm-project?rev=147786&view=rev
Log:
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.


Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=147786&r1=147785&r2=147786&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Jan  9 13:08:06 2012
@@ -988,6 +988,10 @@
 
     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 @@
                           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.





More information about the cfe-commits mailing list