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

Daniel Dunbar daniel at zuster.org
Sun Sep 13 19:20:35 PDT 2009


Author: ddunbar
Date: Sun Sep 13 21:20:34 2009
New Revision: 81748

URL: http://llvm.org/viewvc/llvm-project?rev=81748&view=rev
Log:
ARM/APCS: Don't treat structs w/ floating point types as "integer like".

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=81748&r1=81747&r2=81748&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/TargetABIInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetABIInfo.cpp Sun Sep 13 21:20:34 2009
@@ -1430,6 +1430,10 @@
   if (Ty->isVectorType())
     return false;
 
+  // Float types are never treated as "integer like".
+  if (Ty->isRealFloatingType())
+    return false;
+
   // If this is a builtin or pointer type then it is ok.
   if (Ty->getAsBuiltinType() || Ty->isPointerType())
     return true;

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

==============================================================================
--- cfe/trunk/test/CodeGen/arm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/arm-arguments.c Sun Sep 13 21:20:34 2009
@@ -70,3 +70,17 @@
 // AAPCS: define arm_aapcscc i32 @f12()
 union u12 { char f0; short f1; int f2; };
 union u12 f12(void) {}
+
+// APCS-GNU: define arm_apcscc void @f13(
+// APCS-GNU: struct.s13* noalias sret
+
+// FIXME: This should return a float.
+// AAPCS-FIXME: define arm_aapcscc float @f13()
+struct s13 { float f0; };
+struct s13 f13(void) {}
+
+// APCS-GNU: define arm_apcscc void @f14(
+// APCS-GNU: struct.s13* noalias sret
+// AAPCS: define arm_aapcscc i32 @f14()
+union u14 { float f0; };
+union u14 f14(void) {}





More information about the cfe-commits mailing list