]> granicus.if.org Git - clang/commitdiff
[Hexagon] Make sure to pass empty struct arguments with nontrivial ctors
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 12 May 2017 13:18:07 +0000 (13:18 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 12 May 2017 13:18:07 +0000 (13:18 +0000)
Thanks to Richard Smith for the suggested fix.

This fixes llvm.org/PR33009

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

lib/CodeGen/TargetInfo.cpp
test/CodeGenCXX/array-default-argument.cpp

index 33d6a6ff41450994373db3eece777f7cefdb6060..18367d1602ba4da0617cd18b51e2a5e020a74cc3 100644 (file)
@@ -7043,13 +7043,13 @@ ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty) const {
             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);
index a215c8f2172fe0855589a00c2e766d455c72acc6..a07e3908392a488f2ce456ef938149516e1dc916 100644 (file)
@@ -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();