]> granicus.if.org Git - clang/commitdiff
ARM/APCS: Fix classification of small complex integer types as "integer like".
authorDaniel Dunbar <daniel@zuster.org>
Mon, 1 Feb 2010 23:31:26 +0000 (23:31 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 1 Feb 2010 23:31:26 +0000 (23:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95030 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
test/CodeGen/arm-arguments.c

index c0b5f655fa6f2348f3b73cdf2c8265f683cb257f..07f116a0e0b1461c5974b941b69c06370ca10501 100644 (file)
@@ -1585,9 +1585,9 @@ static bool isIntegerLikeType(QualType Ty,
   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.
index e5b41da38b8c9b946d2233d63d4cf393c42af00c..d313a9b3310f68e9b6876dabd7eac33fd6c0959e 100644 (file)
@@ -138,3 +138,18 @@ _Complex int        f24(void) {}
 _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() {}