[cfe-commits] r81798 - in /cfe/trunk: lib/CodeGen/TargetABIInfo.cpp test/CodeGen/arm-arguments.c

Daniel Dunbar daniel at zuster.org
Mon Sep 14 14:54:04 PDT 2009


Author: ddunbar
Date: Mon Sep 14 16:54:03 2009
New Revision: 81798

URL: http://llvm.org/viewvc/llvm-project?rev=81798&view=rev
Log:
ARM/[A]APCS: Ignore empty records passed as arguments.

Modified:
    cfe/trunk/lib/CodeGen/TargetABIInfo.cpp
    cfe/trunk/test/CodeGen/arm-arguments.c

Modified: cfe/trunk/lib/CodeGen/TargetABIInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetABIInfo.cpp?rev=81798&r1=81797&r2=81798&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/TargetABIInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetABIInfo.cpp Mon Sep 14 16:54:03 2009
@@ -1395,6 +1395,10 @@
     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.

Modified: cfe/trunk/test/CodeGen/arm-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-arguments.c?rev=81798&r1=81797&r2=81798&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/arm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/arm-arguments.c Mon Sep 14 16:54:03 2009
@@ -84,3 +84,11 @@
 // 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) {}





More information about the cfe-commits mailing list