From 09d3362bf57db66780eed3a8f19fdcccae354f57 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 14 Sep 2009 21:54:03 +0000 Subject: [PATCH] ARM/[A]APCS: Ignore empty records passed as arguments. llvm-svn: 81798 --- clang/lib/CodeGen/TargetABIInfo.cpp | 4 ++++ clang/test/CodeGen/arm-arguments.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/clang/lib/CodeGen/TargetABIInfo.cpp b/clang/lib/CodeGen/TargetABIInfo.cpp index c403960580a3..ebc3ecbd5cce 100644 --- a/clang/lib/CodeGen/TargetABIInfo.cpp +++ b/clang/lib/CodeGen/TargetABIInfo.cpp @@ -1395,6 +1395,10 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, return (Ty->isPromotableIntegerType() ? ABIArgInfo::getExtend() : ABIArgInfo::getDirect()); + // Ignore empty records. + if (isEmptyRecord(Context, Ty, true)) + return ABIArgInfo::getIgnore(); + // FIXME: This is kind of nasty... but there isn't much choice because the ARM // backend doesn't support byval. // FIXME: This doesn't handle alignment > 64 bits. diff --git a/clang/test/CodeGen/arm-arguments.c b/clang/test/CodeGen/arm-arguments.c index e58d2fddefcb..c43ede2ca05e 100644 --- a/clang/test/CodeGen/arm-arguments.c +++ b/clang/test/CodeGen/arm-arguments.c @@ -84,3 +84,11 @@ struct s13 f13(void) {} // AAPCS: define arm_aapcscc i32 @f14() union u14 { float f0; }; union u14 f14(void) {} + +// APCS-GNU: define arm_apcscc void @f15() +// AAPCS: define arm_aapcscc void @f15() +void f15(struct s7 a0) {} + +// APCS-GNU: define arm_apcscc void @f16() +// AAPCS: define arm_aapcscc void @f16() +void f16(struct s8 a0) {}