[cfe-commits] r143596 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp

Eli Friedman eli.friedman at gmail.com
Thu Jan 5 15:16:38 PST 2012


On Thu, Jan 5, 2012 at 12:47 PM, Hatanaka, Akira <ahatanaka at mips.com> wrote:
> Please review the attached patch.
>
> I added comments and changed the type of ABIArgInfo's padding to llvm::Type*.

@@ -691,6 +691,9 @@
       // generally likes scalar values better than FCAs.
       llvm::Type *argType = argAI.getCoerceToType();
       if (llvm::StructType *st = dyn_cast<llvm::StructType>(argType)) {
+        // Insert a padding type to ensure proper alignment.
+        if (llvm::Type *PaddingType = argAI.getPaddingType())
+          argTypes.push_back(PaddingType);
         for (unsigned i = 0, e = st->getNumElements(); i != e; ++i)
           argTypes.push_back(st->getElementType(i));
       } else {

Shouldn't we be inserting the padding independent of whether the
following type is a struct type?

Looks fine otherwise.

-Eli



More information about the cfe-commits mailing list