]> granicus.if.org Git - clang/commitdiff
CodeGen: make i686-windows-itanium more similar to msvc
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 24 Nov 2014 20:14:29 +0000 (20:14 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 24 Nov 2014 20:14:29 +0000 (20:14 +0000)
The itanium environment follows the system calling convention for structures.
Pass small aggregates via registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222680 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
test/CodeGen/windows-struct-abi.c

index 3ad8bd950c61af0c9f1e2c2af3ddb1ddd62ab8d3..422feef84e694a4ccb21cf87d10a8a2f3a60580f 100644 (file)
@@ -1307,6 +1307,7 @@ bool X86_32TargetCodeGenInfo::isStructReturnInRegABI(
     case llvm::Triple::UnknownEnvironment:
     case llvm::Triple::Cygnus:
     case llvm::Triple::GNU:
+    case llvm::Triple::Itanium:
     case llvm::Triple::MSVC:
       return true;
     default:
index ec4bab6b47dc4b883b8b10dbb3f77708ce082cce..4b4a6f1b5db3105b2c292d9b4a04666c8e68f6e8 100644 (file)
@@ -6,7 +6,7 @@ struct f1 {
 
 struct f1 return_f1(void) { while (1); }
 
-// CHECK: define void @return_f1(%struct.f1* noalias sret %agg.result)
+// CHECK: define i32 @return_f1()
 
 void receive_f1(struct f1 a0) { }
 
@@ -19,9 +19,24 @@ struct f2 {
 
 struct f2 return_f2(void) { while (1); }
 
-// CHECK: define void @return_f2(%struct.f2* noalias sret %agg.result)
+// CHECK: define i64 @return_f2()
 
 void receive_f2(struct f2 a0) { }
 
 // CHECK: define void @receive_f2(%struct.f2* byval align 4 %a0)
 
+struct f4 {
+  float f;
+  float g;
+  float h;
+  float i;
+};
+
+struct f4 return_f4(void) { while (1); }
+
+// CHECK: define void @return_f4(%struct.f4* noalias sret %agg.result)
+
+void receive_f4(struct f4 a0) { }
+
+// CHECK: define void @receive_f4(%struct.f4* byval align 4 %a0)
+