r302895 - [Hexagon] Make sure to pass empty struct arguments with nontrivial ctors

Krzysztof Parzyszek via cfe-commits cfe-commits at lists.llvm.org
Fri May 12 06:18:07 PDT 2017


Author: kparzysz
Date: Fri May 12 08:18:07 2017
New Revision: 302895

URL: http://llvm.org/viewvc/llvm-project?rev=302895&view=rev
Log:
[Hexagon] Make sure to pass empty struct arguments with nontrivial ctors

Thanks to Richard Smith for the suggested fix.

This fixes llvm.org/PR33009

Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp
    cfe/trunk/test/CodeGenCXX/array-default-argument.cpp

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=302895&r1=302894&r2=302895&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Fri May 12 08:18:07 2017
@@ -7043,13 +7043,13 @@ ABIArgInfo HexagonABIInfo::classifyArgum
             ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
   }
 
+  if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
+    return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
+
   // Ignore empty records.
   if (isEmptyRecord(getContext(), Ty, true))
     return ABIArgInfo::getIgnore();
 
-  if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
-    return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
-
   uint64_t Size = getContext().getTypeSize(Ty);
   if (Size > 64)
     return getNaturalAlignIndirect(Ty, /*ByVal=*/true);

Modified: cfe/trunk/test/CodeGenCXX/array-default-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/array-default-argument.cpp?rev=302895&r1=302894&r2=302895&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/array-default-argument.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/array-default-argument.cpp Fri May 12 08:18:07 2017
@@ -1,10 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple | FileCheck %s
 // RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple -std=c++98 -fexceptions -fcxx-exceptions | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EH
 
-// Hexagon calling convention lowering is horribly broken and fails to pass A
-// object to B constructor at all!
-// XFAIL: hexagon
-
 struct A {
   A();
   ~A();




More information about the cfe-commits mailing list