ARM: enable struct byval for AAPCS.

rdar://9877866
PR://13350

llvm-svn: 161694
This commit is contained in:
Manman Ren 2012-08-10 20:42:31 +00:00
parent e201e27eb1
commit d4badd7420
2 changed files with 7 additions and 3 deletions

View File

@ -2757,9 +2757,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const {
}
}
// FIXME: byval for AAPCS is not yet supported; we need it for performance
// and to support large alignment.
if (getABIKind() == ARMABIInfo::APCS) {
if (getABIKind() == ARMABIInfo::APCS || getABIKind() == ARMABIInfo::AAPCS) {
if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64) ||
getContext().getTypeAlign(Ty) > 64) {
return ABIArgInfo::getIndirect(0, /*ByVal=*/true);

View File

@ -172,3 +172,9 @@ struct s32 { double x; };
void f32(struct s32 s) { }
// AAPCS: @f32([1 x i64] %s.coerce)
// APCS-GNU: @f32([2 x i32] %s.coerce)
// PR13350
struct s33 { char buf[32*32]; };
void f33(struct s33 s) { }
// APCS-GNU: define void @f33(%struct.s33* byval %s)
// AAPCS: define arm_aapcscc void @f33(%struct.s33* byval %s)