<div dir="ltr">Thanks for the revert, fixed up and recommitted in r302817.<div><br></div><div>Any idea why not a single buildbot sent me any email about this? :( (A couple of them were red at the previous change too, but some of them were not (eg. clang-cmake-armv7-a15).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 May 2017 at 01:28, Diana Picus <span dir="ltr"><<a href="mailto:diana.picus@linaro.org" target="_blank">diana.picus@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hexagon too:<br>
<a href="http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/7916" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-hexagon-elf/<wbr>builds/7916</a><br>
<div class="HOEnZb"><div class="h5"><br>
On 11 May 2017 at 10:27, Diana Picus <<a href="mailto:diana.picus@linaro.org">diana.picus@linaro.org</a>> wrote:<br>
> Hi Richard,<br>
><br>
> I reverted this and its fixup in r302776 since some of the ARM bots<br>
> were still broken:<br>
> <a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/6969" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-cmake-armv7-<wbr>a15/builds/6969</a><br>
> <a href="http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/6959" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-cmake-thumbv7-<wbr>a15/builds/6959</a><br>
> <a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/6717" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-cmake-armv7-<wbr>a15-full/builds/6717</a><br>
> <a href="http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/1518" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-cmake-thumbv7-<wbr>a15-full-sh/builds/1518</a><br>
><br>
> Sorry,<br>
> Diana<br>
><br>
> On 11 May 2017 at 02:17, Richard Smith via cfe-commits<br>
> <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
>> Author: rsmith<br>
>> Date: Wed May 10 19:17:17 2017<br>
>> New Revision: 302750<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=302750&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=302750&view=rev</a><br>
>> Log:<br>
>> PR22877: When constructing an array via a constructor with a default argument<br>
>> in list-initialization, run cleanups for the default argument after each<br>
>> iteration of the initialization loop.<br>
>><br>
>> We previously only ran the destructor for any temporary once, at the end of the<br>
>> complete loop, rather than once per iteration!<br>
>><br>
>> Added:<br>
>> cfe/trunk/test/CodeGenCXX/<wbr>array-default-argument.cpp<br>
>> Modified:<br>
>> cfe/trunk/lib/CodeGen/<wbr>CGExprAgg.cpp<br>
>><br>
>> Modified: cfe/trunk/lib/CodeGen/<wbr>CGExprAgg.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=302750&r1=302749&r2=302750&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/CodeGen/<wbr>CGExprAgg.cpp?rev=302750&r1=<wbr>302749&r2=302750&view=diff</a><br>
>> ==============================<wbr>==============================<wbr>==================<br>
>> --- cfe/trunk/lib/CodeGen/<wbr>CGExprAgg.cpp (original)<br>
>> +++ cfe/trunk/lib/CodeGen/<wbr>CGExprAgg.cpp Wed May 10 19:17:17 2017<br>
>> @@ -512,12 +512,20 @@ void AggExprEmitter::EmitArrayInit(<wbr>Addre<br>
>> currentElement->addIncoming(<wbr>element, entryBB);<br>
>><br>
>> // Emit the actual filler expression.<br>
>> - LValue elementLV =<br>
>> - CGF.MakeAddrLValue(Address(<wbr>currentElement, elementAlign), elementType);<br>
>> - if (filler)<br>
>> - EmitInitializationToLValue(<wbr>filler, elementLV);<br>
>> - else<br>
>> - EmitNullInitializationToLValue<wbr>(elementLV);<br>
>> + {<br>
>> + // C++1z [class.temporary]p5:<br>
>> + // when a default constructor is called to initialize an element of<br>
>> + // an array with no corresponding initializer [...] the destruction of<br>
>> + // every temporary created in a default argument is sequenced before<br>
>> + // the construction of the next array element, if any<br>
>> + CodeGenFunction::<wbr>RunCleanupsScope CleanupsScope(CGF);<br>
>> + LValue elementLV =<br>
>> + CGF.MakeAddrLValue(Address(<wbr>currentElement, elementAlign), elementType);<br>
>> + if (filler)<br>
>> + EmitInitializationToLValue(<wbr>filler, elementLV);<br>
>> + else<br>
>> + EmitNullInitializationToLValue<wbr>(elementLV);<br>
>> + }<br>
>><br>
>> // Move on to the next element.<br>
>> llvm::Value *nextElement =<br>
>><br>
>> Added: cfe/trunk/test/CodeGenCXX/<wbr>array-default-argument.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/array-default-argument.cpp?rev=302750&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGenCXX/array-default-<wbr>argument.cpp?rev=302750&view=<wbr>auto</a><br>
>> ==============================<wbr>==============================<wbr>==================<br>
>> --- cfe/trunk/test/CodeGenCXX/<wbr>array-default-argument.cpp (added)<br>
>> +++ cfe/trunk/test/CodeGenCXX/<wbr>array-default-argument.cpp Wed May 10 19:17:17 2017<br>
>> @@ -0,0 +1,36 @@<br>
>> +// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple | FileCheck %s<br>
>> +// RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EH<br>
>> +<br>
>> +struct A {<br>
>> + A();<br>
>> + ~A();<br>
>> +};<br>
>> +<br>
>> +struct B {<br>
>> + B(A = A());<br>
>> + ~B();<br>
>> +};<br>
>> +<br>
>> +void f();<br>
>> +// CHECK-LABEL: define void @_Z1gv()<br>
>> +void g() {<br>
>> + // CHECK: br label %[[LOOP:.*]]<br>
>> +<br>
>> + // [[LOOP]]:<br>
>> + // CHECK: {{call|invoke}} void @_ZN1AC1Ev([[TEMPORARY:.*]])<br>
>> + // CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD:.*]]<br>
>> + // CHECK: {{call|invoke}} void @_ZN1BC1E1A({{.*}}, [[TEMPORARY]])<br>
>> + // CHECK-EH: unwind label %[[A_AND_PARTIAL_ARRAY_LPAD:.*<wbr>]]<br>
>> + // CHECK: {{call|invoke}} void @_ZN1AD1Ev([[TEMPORARY]])<br>
>> + // CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD]]<br>
>> + // CHECK: getelementptr {{.*}}, i{{[0-9]*}} 1<br>
>> + // CHECK: icmp eq<br>
>> + // CHECK: br i1 {{.*}} label %[[LOOP]]<br>
>> + B b[5];<br>
>> +<br>
>> + // CHECK: {{call|invoke}} void @_Z1fv()<br>
>> + f();<br>
>> +<br>
>> + // CHECK-NOT: @_ZN1AD1Ev(<br>
>> + // CHECK: {{call|invoke}} void @_ZN1BD1Ev(<br>
>> +}<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>