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

Daniel Dunbar daniel at zuster.org
Mon Feb 1 15:31:26 PST 2010


Author: ddunbar
Date: Mon Feb  1 17:31:26 2010
New Revision: 95030

URL: http://llvm.org/viewvc/llvm-project?rev=95030&view=rev
Log:
ARM/APCS: Fix classification of small complex integer types as "integer like".

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

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

==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Feb  1 17:31:26 2010
@@ -1585,9 +1585,9 @@
   if (Ty->getAs<BuiltinType>() || Ty->isPointerType())
     return true;
 
-  // Complex types "should" be ok by the definition above, but they are not.
-  if (Ty->isAnyComplexType())
-    return false;
+  // Small complex integer types are "integer like".
+  if (const ComplexType *CT = Ty->getAs<ComplexType>())
+    return isIntegerLikeType(CT->getElementType(), Context, VMContext);
 
   // Single element and zero sized arrays should be allowed, by the definition
   // above, but they are not.

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

==============================================================================
--- cfe/trunk/test/CodeGen/arm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/arm-arguments.c Mon Feb  1 17:31:26 2010
@@ -138,3 +138,18 @@
 _Complex long long  f25(void) {}
 _Complex float      f26(void) {}
 _Complex double     f27(void) {}
+
+// APCS-GNU: define arm_apcscc i16 @f28()
+// AAPCS: define arm_aapcscc i16 @f28()
+struct s28 { _Complex char f0; };
+struct s28 f28() {}
+
+// APCS-GNU: define arm_apcscc i32 @f29()
+// AAPCS: define arm_aapcscc i32 @f29()
+struct s29 { _Complex short f0; };
+struct s29 f29() {}
+
+// APCS-GNU: define arm_apcscc void @f30({{.*}} noalias sret
+// AAPCS: define arm_aapcscc void @f30({{.*}} noalias sret
+struct s30 { _Complex int f0; };
+struct s30 f30() {}





More information about the cfe-commits mailing list