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

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


Author: ddunbar
Date: Mon Feb  1 17:31:19 2010
New Revision: 95029

URL: http://llvm.org/viewvc/llvm-project?rev=95029&view=rev
Log:
ARM/APCS: Pass Complex types following llvm-gcc.

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=95029&r1=95028&r2=95029&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Feb  1 17:31:19 2010
@@ -1661,6 +1661,14 @@
     if (isEmptyRecord(Context, RetTy, false))
       return ABIArgInfo::getIgnore();
 
+    // Complex types are all returned as packed integers.
+    //
+    // FIXME: Consider using 2 x vector types if the back end handles them
+    // correctly.
+    if (RetTy->isAnyComplexType())
+      return ABIArgInfo::getCoerce(llvm::IntegerType::get(
+                                     VMContext, Context.getTypeSize(RetTy)));
+
     // Integer like structures are returned in r0.
     if (isIntegerLikeType(RetTy, Context, VMContext)) {
       // Return in the smallest viable integer type.

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

==============================================================================
--- cfe/trunk/test/CodeGen/arm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/arm-arguments.c Mon Feb  1 17:31:19 2010
@@ -119,3 +119,22 @@
 // AAPCS: define arm_aapcscc i32 @f21()
 struct s21 { struct {} f1; int f0 : 4; };
 struct s21 f21(void) {}
+
+// APCS-GNU: define arm_apcscc i16 @f22()
+// APCS-GNU: define arm_apcscc i32 @f23()
+// APCS-GNU: define arm_apcscc i64 @f24()
+// APCS-GNU: define arm_apcscc i128 @f25()
+// APCS-GNU: define arm_apcscc i64 @f26()
+// APCS-GNU: define arm_apcscc i128 @f27()
+// AAPCS: define arm_aapcscc i16 @f22()
+// AAPCS: define arm_aapcscc i32 @f23()
+// AAPCS: define arm_aapcscc void @f24({{.*}} noalias sret
+// AAPCS: define arm_aapcscc void @f25({{.*}} noalias sret
+// AAPCS: define arm_aapcscc void @f26({{.*}} noalias sret
+// AAPCS: define arm_aapcscc void @f27({{.*}} noalias sret
+_Complex char       f22(void) {}
+_Complex short      f23(void) {}
+_Complex int        f24(void) {}
+_Complex long long  f25(void) {}
+_Complex float      f26(void) {}
+_Complex double     f27(void) {}





More information about the cfe-commits mailing list