r302776 - Revert "PR22877: When constructing an array via a constructor with a default argument in list-initialization, run cleanups for the default argument after each iteration of the initialization loop."

Diana Picus via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 01:10:41 PDT 2017


Author: rovka
Date: Thu May 11 03:10:41 2017
New Revision: 302776

URL: http://llvm.org/viewvc/llvm-project?rev=302776&view=rev
Log:
Revert "PR22877: When constructing an array via a constructor with a default argument in list-initialization, run cleanups for the default argument after each iteration of the initialization loop."

Revert "clang/test/CodeGenCXX/array-default-argument.cpp: Satisfy targets that have x86_thiscallcc."

This reverts commit r302750 and its fixup r302757 because the test is
still breaking on some of the ARM bots.

array-default-argument.cpp:20:12: error: expected string not found in input
 // CHECK: {{call|invoke}}[[THISCALL:( x86_thiscallcc)?]] void @_ZN1AC1Ev([[TEMPORARY:.*]])
           ^
<stdin>:18:1: note: scanning from here
arrayctor.loop: ; preds = %arrayctor.loop, %entry
^
<stdin>:28:2: note: possible intended match here
 call void @_Z1fv()
 ^

--

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

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=302776&r1=302775&r2=302776&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Thu May 11 03:10:41 2017
@@ -512,20 +512,12 @@ void AggExprEmitter::EmitArrayInit(Addre
     currentElement->addIncoming(element, entryBB);
 
     // Emit the actual filler expression.
-    {
-      // C++1z [class.temporary]p5:
-      //   when a default constructor is called to initialize an element of
-      //   an array with no corresponding initializer [...] the destruction of
-      //   every temporary created in a default argument is sequenced before
-      //   the construction of the next array element, if any
-      CodeGenFunction::RunCleanupsScope CleanupsScope(CGF);
-      LValue elementLV =
-        CGF.MakeAddrLValue(Address(currentElement, elementAlign), elementType);
-      if (filler)
-        EmitInitializationToLValue(filler, elementLV);
-      else
-        EmitNullInitializationToLValue(elementLV);
-    }
+    LValue elementLV =
+      CGF.MakeAddrLValue(Address(currentElement, elementAlign), elementType);
+    if (filler)
+      EmitInitializationToLValue(filler, elementLV);
+    else
+      EmitNullInitializationToLValue(elementLV);
 
     // Move on to the next element.
     llvm::Value *nextElement =

Removed: cfe/trunk/test/CodeGenCXX/array-default-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/array-default-argument.cpp?rev=302775&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/array-default-argument.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/array-default-argument.cpp (removed)
@@ -1,36 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EH
-
-struct A {
-  A();
-  ~A();
-};
-
-struct B {
-  B(A = A());
-  ~B();
-};
-
-void f();
-// CHECK-LABEL: define void @_Z1gv()
-void g() {
-  // CHECK: br label %[[LOOP:.*]]
-
-  // [[LOOP]]:
-  // CHECK: {{call|invoke}}[[THISCALL:( x86_thiscallcc)?]] void @_ZN1AC1Ev([[TEMPORARY:.*]])
-  // CHECK-EH:  unwind label %[[PARTIAL_ARRAY_LPAD:.*]]
-  // CHECK: {{call|invoke}}[[THISCALL]] void @_ZN1BC1E1A({{.*}}, [[TEMPORARY]])
-  // CHECK-EH:  unwind label %[[A_AND_PARTIAL_ARRAY_LPAD:.*]]
-  // CHECK: {{call|invoke}}[[THISCALL]] void @_ZN1AD1Ev([[TEMPORARY]])
-  // CHECK-EH:  unwind label %[[PARTIAL_ARRAY_LPAD]]
-  // CHECK: getelementptr {{.*}}, i{{[0-9]*}} 1
-  // CHECK: icmp eq
-  // CHECK: br i1 {{.*}} label %[[LOOP]]
-  B b[5];
-
-  // CHECK: {{call|invoke}} void @_Z1fv()
-  f();
-
-  // CHECK-NOT: @_ZN1AD1Ev(
-  // CHECK: {{call|invoke}}[[THISCALL]] void @_ZN1BD1Ev(
-}




More information about the cfe-commits mailing list