summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-05 01:31:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-05 01:31:19 +0000
commit0103574d5500e9a3026aa48083e6dcd723387cc0 (patch)
tree7ce7fb3a8e0b03d7bf1858707b293851089d4520 /clang/lib/CodeGen/CGCall.cpp
parent4e87c834d309ae731e65d7c28dc290b593c5715b (diff)
downloadbcm5719-llvm-0103574d5500e9a3026aa48083e6dcd723387cc0.tar.gz
bcm5719-llvm-0103574d5500e9a3026aa48083e6dcd723387cc0.zip
Honor ByVal alignment. Patch by Nate Begeman!
llvm-svn: 63811
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 61c6653236d..b0a2f586ea3 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/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:
OpenPOWER on IntegriCloud