summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2014-03-12 14:02:50 +0000
committerOliver Stannard <oliver.stannard@arm.com>2014-03-12 14:02:50 +0000
commit7c3c09e23fe4b2752dbbf957d6bebbf72e7b0319 (patch)
treeed1cd4427f1323a6b6e326834dd86179f6203c38 /clang/lib/CodeGen/TargetInfo.cpp
parent61c76cc56fc4481425e65f69eb32eece5d7c08df (diff)
downloadbcm5719-llvm-7c3c09e23fe4b2752dbbf957d6bebbf72e7b0319.tar.gz
bcm5719-llvm-7c3c09e23fe4b2752dbbf957d6bebbf72e7b0319.zip
ARM: Correct alignment of structs passed as byval pointer
When a struct has bitfields overlapping with other members (as required by the AAPCS), clang uses a packed struct to represent this. If such a struct is large enough for clang to pass it as a byval pointer (>64 bytes), we need to set the alignment of the argument to match the original type. llvm-svn: 203660
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index b7d45cf91c3..b0eccd7a17e 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -3649,7 +3649,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool &IsHA,
if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64)) {
// Update Allocated GPRs
markAllocatedGPRs(1, 1);
- return ABIArgInfo::getIndirect(0, /*ByVal=*/true,
+ return ABIArgInfo::getIndirect(TyAlign, /*ByVal=*/true,
/*Realign=*/TyAlign > ABIAlign);
}
OpenPOWER on IntegriCloud