[llvm-branch-commits] [cfe-branch] r352855 - Merging r352822:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Feb 1 02:57:17 PST 2019


Author: hans
Date: Fri Feb  1 02:57:17 2019
New Revision: 352855

URL: http://llvm.org/viewvc/llvm-project?rev=352855&view=rev
Log:
Merging r352822:
------------------------------------------------------------------------
r352822 | ahatanak | 2019-02-01 01:12:06 +0100 (Fri, 01 Feb 2019) | 8 lines

Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed"

This reverts commit r350920 as it is not clear whether we should force a
class to be returned in registers when copy and move constructors are
both deleted.

For more background, see the following discussion:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html
------------------------------------------------------------------------

Modified:
    cfe/branches/release_80/   (props changed)
    cfe/branches/release_80/lib/Sema/SemaDeclCXX.cpp
    cfe/branches/release_80/test/CodeGenCXX/trivial_abi.cpp

Propchange: cfe/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb  1 02:57:17 2019
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351579-351580,352040,352079,352099,352102,352105,352221-352222,352229,352323,352539,352610,352672
+/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351579-351580,352040,352079,352099,352102,352105,352221-352222,352229,352323,352539,352610,352672,352822
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_80/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/lib/Sema/SemaDeclCXX.cpp?rev=352855&r1=352854&r2=352855&view=diff
==============================================================================
--- cfe/branches/release_80/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/release_80/lib/Sema/SemaDeclCXX.cpp Fri Feb  1 02:57:17 2019
@@ -5890,9 +5890,6 @@ static bool canPassInRegisters(Sema &S,
   if (D->isDependentType() || D->isInvalidDecl())
     return false;
 
-  if (D->hasAttr<TrivialABIAttr>())
-    return true;
-
   // Clang <= 4 used the pre-C++11 rule, which ignores move operations.
   // The PS4 platform ABI follows the behavior of Clang 3.2.
   if (CCK == TargetInfo::CCK_ClangABI4OrPS4)

Modified: cfe/branches/release_80/test/CodeGenCXX/trivial_abi.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/test/CodeGenCXX/trivial_abi.cpp?rev=352855&r1=352854&r2=352855&view=diff
==============================================================================
--- cfe/branches/release_80/test/CodeGenCXX/trivial_abi.cpp (original)
+++ cfe/branches/release_80/test/CodeGenCXX/trivial_abi.cpp Fri Feb  1 02:57:17 2019
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++17 -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++17 -fcxx-exceptions -fexceptions -fclang-abi-compat=4.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++11 -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -std=c++11 -fcxx-exceptions -fexceptions -fclang-abi-compat=4.0 -emit-llvm -o - %s | FileCheck %s
 
 // CHECK: %[[STRUCT_SMALL:.*]] = type { i32* }
 // CHECK: %[[STRUCT_LARGE:.*]] = type { i32*, [128 x i32] }
@@ -43,13 +43,6 @@ struct HasNonTrivial {
   NonTrivial m;
 };
 
-struct __attribute__((trivial_abi)) CopyMoveDeleted {
-  CopyMoveDeleted(int);
-  CopyMoveDeleted(const CopyMoveDeleted &) = delete;
-  CopyMoveDeleted(CopyMoveDeleted &&) = delete;
-  int a;
-};
-
 // CHECK: define void @_Z14testParamSmall5Small(i64 %[[A_COERCE:.*]])
 // CHECK: %[[A:.*]] = alloca %[[STRUCT_SMALL]], align 8
 // CHECK: %[[COERCE_DIVE:.*]] = getelementptr inbounds %[[STRUCT_SMALL]], %[[STRUCT_SMALL]]* %[[A]], i32 0, i32 0
@@ -244,11 +237,3 @@ void calleeExceptionLarge(Large, Large);
 void testExceptionLarge() {
   calleeExceptionLarge(Large(), Large());
 }
-
-// A class with deleted copy and move constructors can still be passed or
-// returned in registers if the class is annotated with trivial_abi.
-
-// CHECK: define i64 @_Z19testCopyMoveDeletedi(i32 %
-CopyMoveDeleted testCopyMoveDeleted(int a) {
-  return a;
-}




More information about the llvm-branch-commits mailing list