diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-05 01:31:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-05 01:31:19 +0000 |
commit | ca008822e8ad5dd8b3ff598cf62e909966847a67 (patch) | |
tree | 409f613a4873cf0a13a91ab01c7d39c34be924a7 | |
parent | ef163782d227f064df5988d46487609324a0169e (diff) |
Honor ByVal alignment. Patch by Nate Begeman!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63811 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 61c6653236..b0a2f586ea 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -316,6 +316,7 @@ ABIArgInfo X86_32ABIInfo::classifyReturnType(QualType RetTy, 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 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI, bool IsVariadic) { 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 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, case ABIArgInfo::ByVal: Attributes |= llvm::Attribute::ByVal; - assert(AI.getByValAlignment() == 0 && "FIXME: alignment unhandled"); + Attributes |= + llvm::Attribute::constructAlignmentFromInt(AI.getByValAlignment()); break; case ABIArgInfo::Direct: |