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

Daniel Dunbar daniel at zuster.org
Wed Feb 4 17:31:19 PST 2009


Author: ddunbar
Date: Wed Feb  4 19:31:19 2009
New Revision: 63811

URL: http://llvm.org/viewvc/llvm-project?rev=63811&view=rev
Log:
Honor ByVal alignment. Patch by Nate Begeman!

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=63811&r1=63810&r2=63811&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Feb  4 19:31:19 2009
@@ -316,6 +316,7 @@
 
 ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty,
                                               ASTContext &Context) const {
+  // FIXME: Set alignment on byval arguments.
   if (CodeGenFunction::hasAggregateLLVMType(Ty)) {
     // Structures with flexible arrays are always byval.
     if (const RecordType *RT = Ty->getAsStructureType())
@@ -1066,7 +1067,6 @@
     case ABIArgInfo::ByVal:
       // byval arguments are always on the stack, which is addr space #0.
       ArgTys.push_back(llvm::PointerType::getUnqual(Ty));
-      assert(AI.getByValAlignment() == 0 && "FIXME: alignment unhandled");
       break;
       
     case ABIArgInfo::Direct:
@@ -1146,7 +1146,8 @@
 
     case ABIArgInfo::ByVal:
       Attributes |= llvm::Attribute::ByVal;
-      assert(AI.getByValAlignment() == 0 && "FIXME: alignment unhandled");
+      Attributes |= 
+        llvm::Attribute::constructAlignmentFromInt(AI.getByValAlignment());
       break;
       
     case ABIArgInfo::Direct:





More information about the cfe-commits mailing list